summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/tests/test_util.py
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-10-25 23:08:47 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2009-10-25 23:08:47 (GMT)
commit04fe7c01a8a0dd8a7234dd0f527e22386c2fed04 (patch)
treef4227e1b677431d14f9d8757e6ade6d858f422cc /Lib/distutils/tests/test_util.py
parent4824c25e756280b13705c00fd56cb307e5a44cc7 (diff)
downloadcpython-04fe7c01a8a0dd8a7234dd0f527e22386c2fed04.zip
cpython-04fe7c01a8a0dd8a7234dd0f527e22386c2fed04.tar.gz
cpython-04fe7c01a8a0dd8a7234dd0f527e22386c2fed04.tar.bz2
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 'Lib/distutils/tests/test_util.py')
-rw-r--r--Lib/distutils/tests/test_util.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/Lib/distutils/tests/test_util.py b/Lib/distutils/tests/test_util.py
index 8068726..a2f8ed2 100644
--- a/Lib/distutils/tests/test_util.py
+++ b/Lib/distutils/tests/test_util.py
@@ -1,7 +1,4 @@
"""Tests for distutils.util."""
-# not covered yet:
-# - byte_compile
-#
import os
import sys
import unittest
@@ -9,11 +6,12 @@ from copy import copy
from io import BytesIO
import subprocess
-from distutils.errors import DistutilsPlatformError
+from distutils.errors import DistutilsPlatformError, DistutilsByteCompileError
from distutils.util import (get_platform, convert_path, change_root,
check_environ, split_quoted, strtobool,
rfc822_escape, get_compiler_versions,
- _find_exe_version, _MAC_OS_X_LD_VERSION)
+ _find_exe_version, _MAC_OS_X_LD_VERSION,
+ byte_compile)
from distutils import util
from distutils.sysconfig import get_config_vars
from distutils import sysconfig
@@ -349,6 +347,16 @@ class UtilTestCase(support.EnvironGuard, unittest.TestCase):
res = get_compiler_versions()
self.assertEquals(res[2], None)
+ def test_dont_write_bytecode(self):
+ # makes sure byte_compile raise a DistutilsError
+ # if sys.dont_write_bytecode is True
+ old_dont_write_bytecode = sys.dont_write_bytecode
+ sys.dont_write_bytecode = True
+ try:
+ self.assertRaises(DistutilsByteCompileError, byte_compile, [])
+ finally:
+ sys.dont_write_bytecode = old_dont_write_bytecode
+
def test_suite():
return unittest.makeSuite(UtilTestCase)