diff options
| author | R. David Murray <rdmurray@bitdance.com> | 2010-02-23 00:24:49 (GMT) |
|---|---|---|
| committer | R. David Murray <rdmurray@bitdance.com> | 2010-02-23 00:24:49 (GMT) |
| commit | f28fd24c36310541a1f3ec74e92e8d38629dd5d8 (patch) | |
| tree | ca85998492ba91f8874ba63fecd77397f65ad3d6 /Lib/distutils/tests/test_build_py.py | |
| parent | 87bcb243acfd758b3e91e194bf8f1198ae68a792 (diff) | |
| download | cpython-f28fd24c36310541a1f3ec74e92e8d38629dd5d8.zip cpython-f28fd24c36310541a1f3ec74e92e8d38629dd5d8.tar.gz cpython-f28fd24c36310541a1f3ec74e92e8d38629dd5d8.tar.bz2 | |
Issue 6292: for the moment at least, the test suite passes if run
with -OO. Tests requiring docstrings are skipped. Patch by
Brian Curtin, thanks to Matias Torchinsky for helping review and
improve the patch.
Diffstat (limited to 'Lib/distutils/tests/test_build_py.py')
| -rw-r--r-- | Lib/distutils/tests/test_build_py.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Lib/distutils/tests/test_build_py.py b/Lib/distutils/tests/test_build_py.py index 472591d..3c8bc41 100644 --- a/Lib/distutils/tests/test_build_py.py +++ b/Lib/distutils/tests/test_build_py.py @@ -16,7 +16,7 @@ class BuildPyTestCase(support.TempdirManager, support.LoggingSilencer, unittest.TestCase): - def test_package_data(self): + def _setup_package_data(self): sources = self.mkdtemp() f = open(os.path.join(sources, "__init__.py"), "w") f.write("# Pretend this is a package.") @@ -52,10 +52,19 @@ class BuildPyTestCase(support.TempdirManager, self.assertEqual(len(cmd.get_outputs()), 3) pkgdest = os.path.join(destination, "pkg") files = os.listdir(pkgdest) + return files + + def test_package_data(self): + files = self._setup_package_data() self.assertTrue("__init__.py" in files) - self.assertTrue("__init__.pyc" in files) self.assertTrue("README.txt" in files) + @unittest.skipIf(sys.flags.optimize >= 2, + "pyc files are not written with -O2 and above") + def test_package_data_pyc(self): + files = self._setup_package_data() + self.assertTrue("__init__.pyc" in files) + def test_empty_package_dir (self): # See SF 1668596/1720897. cwd = os.getcwd() |
