summaryrefslogtreecommitdiff
path: root/tests/test_install_lib.py
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-10-25 23:08:47 +0000
committerTarek Ziadé <ziade.tarek@gmail.com>2009-10-25 23:08:47 +0000
commit389e4ff03d3ae338adf08fc8dc35693b07b332e3 (patch)
tree46d8aea103a89190c65a09ee2e9e4a2348da9630 /tests/test_install_lib.py
parent283c3eac2d9e113f876c649e5ddb1dcbf9a6e096 (diff)
downloadpython-setuptools-git-389e4ff03d3ae338adf08fc8dc35693b07b332e3.tar.gz
Merged revisions 75669-75671 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r75669 | tarek.ziade | 2009-10-24 17:10:37 +0200 (Sat, 24 Oct 2009) | 1 line Issue #7071: byte-compilation in Distutils now looks at sys.dont_write_bytecode ........ r75670 | tarek.ziade | 2009-10-24 17:19:03 +0200 (Sat, 24 Oct 2009) | 1 line fixed finally state in distutils.test_util ........ r75671 | tarek.ziade | 2009-10-24 17:51:30 +0200 (Sat, 24 Oct 2009) | 1 line fixed warning and error message ........
Diffstat (limited to 'tests/test_install_lib.py')
-rw-r--r--tests/test_install_lib.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_install_lib.py b/tests/test_install_lib.py
index b2185b84..99a6d906 100644
--- a/tests/test_install_lib.py
+++ b/tests/test_install_lib.py
@@ -31,6 +31,8 @@ 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):
pkg_dir, dist = self.create_dist()
cmd = install_lib(dist)
@@ -76,6 +78,21 @@ class InstallLibTestCase(support.TempdirManager,
# get_input should return 2 elements
self.assertEquals(len(cmd.get_inputs()), 2)
+ def test_dont_write_bytecode(self):
+ # makes sure byte_compile is not used
+ pkg_dir, dist = self.create_dist()
+ cmd = install_lib(dist)
+ cmd.compile = 1
+ cmd.optimize = 1
+
+ old_dont_write_bytecode = sys.dont_write_bytecode
+ sys.dont_write_bytecode = True
+ try:
+ cmd.byte_compile([])
+ finally:
+ sys.dont_write_bytecode = old_dont_write_bytecode
+
+ self.assertTrue('byte-compiling is disabled' in self.logs[0][1])
def test_suite():
return unittest.makeSuite(InstallLibTestCase)