summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/tests/test_install_lib.py
diff options
context:
space:
mode:
authorR. David Murray <rdmurray@bitdance.com>2010-02-24 01:46:21 (GMT)
committerR. David Murray <rdmurray@bitdance.com>2010-02-24 01:46:21 (GMT)
commit378c0cf5abb4c49c1a95597d3c5284dc93dd7822 (patch)
tree0a7c9a724887dff98a5abefd9b09da0de6889731 /Lib/distutils/tests/test_install_lib.py
parent72aee3dcabf98a0b8a7a60cccab4fbd1ef63fbd2 (diff)
downloadcpython-378c0cf5abb4c49c1a95597d3c5284dc93dd7822.zip
cpython-378c0cf5abb4c49c1a95597d3c5284dc93dd7822.tar.gz
cpython-378c0cf5abb4c49c1a95597d3c5284dc93dd7822.tar.bz2
Merged revisions 78351 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r78351 | r.david.murray | 2010-02-22 19:24:49 -0500 (Mon, 22 Feb 2010) | 5 lines 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_install_lib.py')
-rw-r--r--Lib/distutils/tests/test_install_lib.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/Lib/distutils/tests/test_install_lib.py b/Lib/distutils/tests/test_install_lib.py
index 99a6d90..13d27ab 100644
--- a/Lib/distutils/tests/test_install_lib.py
+++ b/Lib/distutils/tests/test_install_lib.py
@@ -1,6 +1,6 @@
"""Tests for distutils.command.install_data."""
-import sys
import os
+import sys
import unittest
from distutils.command.install_lib import install_lib
@@ -31,9 +31,7 @@ class InstallLibTestCase(support.TempdirManager,
cmd.finalize_options()
self.assertEquals(cmd.optimize, 2)
- @unittest.skipUnless(not sys.dont_write_bytecode,
- 'byte-compile not supported')
- def test_byte_compile(self):
+ def _setup_byte_compile(self):
pkg_dir, dist = self.create_dist()
cmd = install_lib(dist)
cmd.compile = cmd.optimize = 1
@@ -41,8 +39,15 @@ class InstallLibTestCase(support.TempdirManager,
f = os.path.join(pkg_dir, 'foo.py')
self.write_file(f, '# python file')
cmd.byte_compile([f])
- self.assertTrue(os.path.exists(os.path.join(pkg_dir, 'foo.pyc')))
- self.assertTrue(os.path.exists(os.path.join(pkg_dir, 'foo.pyo')))
+ return pkg_dir
+
+ @unittest.skipIf(sys.dont_write_bytecode, 'byte-compile not enabled')
+ def test_byte_compile(self):
+ pkg_dir = self._setup_byte_compile()
+ if sys.flags.optimize < 1:
+ self.assertTrue(os.path.exists(os.path.join(pkg_dir, 'foo.pyc')))
+ else:
+ self.assertTrue(os.path.exists(os.path.join(pkg_dir, 'foo.pyo')))
def test_get_outputs(self):
pkg_dir, dist = self.create_dist()