source: python/trunk/Lib/distutils/tests/test_util.py

Last change on this file was 391, checked in by dmik, 11 years ago

python: Merge vendor 2.7.6 to trunk.

  • Property svn:eol-style set to native
File size: 791 bytes
Line 
1"""Tests for distutils.util."""
2import sys
3import unittest
4from test.test_support import run_unittest
5
6from distutils.errors import DistutilsPlatformError, DistutilsByteCompileError
7from distutils.util import byte_compile
8
9class UtilTestCase(unittest.TestCase):
10
11 def test_dont_write_bytecode(self):
12 # makes sure byte_compile raise a DistutilsError
13 # if sys.dont_write_bytecode is True
14 old_dont_write_bytecode = sys.dont_write_bytecode
15 sys.dont_write_bytecode = True
16 try:
17 self.assertRaises(DistutilsByteCompileError, byte_compile, [])
18 finally:
19 sys.dont_write_bytecode = old_dont_write_bytecode
20
21def test_suite():
22 return unittest.makeSuite(UtilTestCase)
23
24if __name__ == "__main__":
25 run_unittest(test_suite())
Note: See TracBrowser for help on using the repository browser.