diff options
author | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-10-24 15:10:37 (GMT) |
---|---|---|
committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-10-24 15:10:37 (GMT) |
commit | b9c1cfc42881370322ff6894568b45dcfec5ba2e (patch) | |
tree | 590778ae7770d5c8dcdfbffc7f77c8b91ccd4c30 /Lib/distutils/tests/test_build_py.py | |
parent | da8652d920210a5ff783a7ad30f4c24d2b5ff2a2 (diff) | |
download | cpython-b9c1cfc42881370322ff6894568b45dcfec5ba2e.zip cpython-b9c1cfc42881370322ff6894568b45dcfec5ba2e.tar.gz cpython-b9c1cfc42881370322ff6894568b45dcfec5ba2e.tar.bz2 |
Issue #7071: byte-compilation in Distutils now looks at sys.dont_write_bytecode
Diffstat (limited to 'Lib/distutils/tests/test_build_py.py')
-rw-r--r-- | Lib/distutils/tests/test_build_py.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/distutils/tests/test_build_py.py b/Lib/distutils/tests/test_build_py.py index c815d81..e8c7ca9 100644 --- a/Lib/distutils/tests/test_build_py.py +++ b/Lib/distutils/tests/test_build_py.py @@ -89,6 +89,22 @@ class BuildPyTestCase(support.TempdirManager, os.chdir(cwd) sys.stdout = sys.__stdout__ + def test_dont_write_bytecode(self): + # makes sure byte_compile is not used + pkg_dir, dist = self.create_dist() + cmd = build_py(dist) + cmd.compile = 1 + cmd.optimize = 1 + + old_dont_write_bytecode = sys.dont_write_bytecode + sys.dont_write_bytecode = True + try: + cmd.byte_compile([]) + finally: + sys.dont_write_bytecode = old_dont_write_bytecode + + self.assertTrue('byte-compile not supported ' in self.logs[0][1]) + def test_suite(): return unittest.makeSuite(BuildPyTestCase) |