diff options
| author | Éric Araujo <merwok@netwok.org> | 2011-05-28 22:56:39 (GMT) |
|---|---|---|
| committer | Éric Araujo <merwok@netwok.org> | 2011-05-28 22:56:39 (GMT) |
| commit | 601aba6f15fe77b9ebfd40b8324d789e4250a194 (patch) | |
| tree | f7fe470f0bc52558263b6b212f59033d7e461fa4 /Lib | |
| parent | 05010706697ce9c18e7f8a8e571753b0bcfd6548 (diff) | |
| parent | c5069e00705a499c2db37deb5d0eefae791d39ea (diff) | |
| download | cpython-601aba6f15fe77b9ebfd40b8324d789e4250a194.zip cpython-601aba6f15fe77b9ebfd40b8324d789e4250a194.tar.gz cpython-601aba6f15fe77b9ebfd40b8324d789e4250a194.tar.bz2 | |
Merge touch-ups and fixes for #9831 (+port fix to packaging) and #9223 from 3.2
Diffstat (limited to 'Lib')
| -rw-r--r-- | Lib/distutils/tests/test_build_py.py | 17 | ||||
| -rw-r--r-- | Lib/packaging/tests/test_command_build_py.py | 9 |
2 files changed, 16 insertions, 10 deletions
diff --git a/Lib/distutils/tests/test_build_py.py b/Lib/distutils/tests/test_build_py.py index 00a57cc..4e46339 100644 --- a/Lib/distutils/tests/test_build_py.py +++ b/Lib/distutils/tests/test_build_py.py @@ -57,12 +57,15 @@ class BuildPyTestCase(support.TempdirManager, self.assertEqual(len(cmd.get_outputs()), 3) pkgdest = os.path.join(destination, "pkg") files = os.listdir(pkgdest) - self.assertTrue("__init__.py" in files) - if not sys.dont_write_bytecode: - self.assertTrue("__init__.pyc" in files) - self.assertTrue("README.txt" in files) - - def test_empty_package_dir (self): + self.assertIn("__init__.py", files) + self.assertIn("README.txt", files) + # XXX even with -O, distutils writes pyc, not pyo; bug? + if sys.dont_write_bytecode: + self.assertNotIn("__init__.pyc", files) + else: + self.assertIn("__init__.pyc", files) + + def test_empty_package_dir(self): # See SF 1668596/1720897. cwd = os.getcwd() @@ -110,7 +113,7 @@ class BuildPyTestCase(support.TempdirManager, finally: sys.dont_write_bytecode = old_dont_write_bytecode - self.assertTrue('byte-compiling is disabled' in self.logs[0][1]) + self.assertIn('byte-compiling is disabled', self.logs[0][1]) def test_suite(): return unittest.makeSuite(BuildPyTestCase) diff --git a/Lib/packaging/tests/test_command_build_py.py b/Lib/packaging/tests/test_command_build_py.py index b6d60de..49069f5 100644 --- a/Lib/packaging/tests/test_command_build_py.py +++ b/Lib/packaging/tests/test_command_build_py.py @@ -61,9 +61,12 @@ class BuildPyTestCase(support.TempdirManager, pkgdest = os.path.join(destination, "pkg") files = os.listdir(pkgdest) self.assertIn("__init__.py", files) - if not sys.dont_write_bytecode: - self.assertIn("__init__.pyc", files) self.assertIn("README.txt", files) + # XXX even with -O, distutils writes pyc, not pyo; bug? + if sys.dont_write_bytecode: + self.assertNotIn("__init__.pyc", files) + else: + self.assertIn("__init__.pyc", files) def test_empty_package_dir(self): # See SF 1668596/1720897. @@ -93,7 +96,7 @@ class BuildPyTestCase(support.TempdirManager, try: dist.run_commands() - except PackagingFileError as e: + except PackagingFileError: self.fail("failed package_data test when package_dir is ''") finally: # Restore state. |
