cpython: 3d56e559ffc6 (original) (raw)
Mercurial > cpython
changeset 70483:3d56e559ffc6 3.1
Fix test_build_py when sys.dont_write_bytecode is true (#9831). The tests now pass all combinations of -O/-OO and -B. See also #7071 and #6292 for previous variations on the same theme. test_versionpredicate needs a skip when sys.flags.optimize is true, but I don’t know how to make that work with a DocTestSuite. [#9831]
Éric Araujo merwok@netwok.org | |
---|---|
date | Sat, 28 May 2011 23:32:50 +0200 |
parents | fa7d0bbb273d |
children | 3e355c594471 |
files | Lib/distutils/tests/test_build_py.py |
diffstat | 1 files changed, 9 insertions(+), 5 deletions(-)[+] [-] Lib/distutils/tests/test_build_py.py 14 |
line wrap: on
line diff
--- a/Lib/distutils/tests/test_build_py.py +++ b/Lib/distutils/tests/test_build_py.py @@ -57,11 +57,15 @@ class BuildPyTestCase(support.TempdirMan self.assertEqual(len(cmd.get_outputs()), 3) pkgdest = os.path.join(destination, "pkg") files = os.listdir(pkgdest)
self.assertTrue("__init__.py" in files)[](#l1.7)
self.assertTrue("__init__.pyc" in files)[](#l1.8)
self.assertTrue("README.txt" in files)[](#l1.9)
self.assertIn("__init__.py", files)[](#l1.10)
self.assertIn("README.txt", files)[](#l1.11)
# XXX even with -O, distutils writes pyc, not pyo; bug?[](#l1.12)
if sys.dont_write_bytecode:[](#l1.13)
self.assertNotIn("__init__.pyc", files)[](#l1.14)
else:[](#l1.15)
self.assertIn("__init__.pyc", files)[](#l1.16)
@@ -109,7 +113,7 @@ class BuildPyTestCase(support.TempdirMan finally: sys.dont_write_bytecode = old_dont_write_bytecode
self.assertTrue('byte-compiling is disabled' in self.logs[0][1])[](#l1.27)
self.assertIn('byte-compiling is disabled', self.logs[0][1])[](#l1.28)
def test_suite(): return unittest.makeSuite(BuildPyTestCase)