All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lib-python.2.7.distutils.tests.test_util.py Maven / Gradle / Ivy

Go to download

Jython is an implementation of the high-level, dynamic, object-oriented language Python written in 100% Pure Java, and seamlessly integrated with the Java platform. It thus allows you to run Python on any Java platform.

There is a newer version: 2.7.4
Show newest version
"""Tests for distutils.util."""
import sys
import unittest
from test.test_support import run_unittest

from distutils.errors import DistutilsPlatformError, DistutilsByteCompileError
from distutils.util import byte_compile

class UtilTestCase(unittest.TestCase):

    def test_dont_write_bytecode(self):
        # makes sure byte_compile raise a DistutilsError
        # if sys.dont_write_bytecode is True
        old_dont_write_bytecode = sys.dont_write_bytecode
        sys.dont_write_bytecode = True
        try:
            self.assertRaises(DistutilsByteCompileError, byte_compile, [])
        finally:
            sys.dont_write_bytecode = old_dont_write_bytecode

def test_suite():
    return unittest.makeSuite(UtilTestCase)

if __name__ == "__main__":
    run_unittest(test_suite())




© 2015 - 2024 Weber Informatics LLC | Privacy Policy