mirror of
https://github.com/python/cpython.git
synced 2025-08-15 22:30:42 +00:00
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.
This commit is contained in:
parent
87bcb243ac
commit
f28fd24c36
19 changed files with 194 additions and 41 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue