[Python-checkins] cpython: Issue #12120, Issue #12119: tests were missing a sys.dont_write_bytecode check

tarek.ziade python-checkins at python.org
Thu May 19 19:56:23 CEST 2011


http://hg.python.org/cpython/rev/9d1fb6a9104b
changeset:   70207:9d1fb6a9104b
user:        Tarek Ziade <tarek at ziade.org>
date:        Thu May 19 19:56:12 2011 +0200
summary:
  Issue #12120, Issue #12119: tests were missing a sys.dont_write_bytecode check

files:
  Lib/distutils/tests/test_build_py.py         |  3 ++-
  Lib/packaging/tests/test_command_build_py.py |  3 ++-
  Misc/NEWS                                    |  3 +++
  3 files changed, 7 insertions(+), 2 deletions(-)


diff --git a/Lib/distutils/tests/test_build_py.py b/Lib/distutils/tests/test_build_py.py
--- a/Lib/distutils/tests/test_build_py.py
+++ b/Lib/distutils/tests/test_build_py.py
@@ -58,7 +58,8 @@
         pkgdest = os.path.join(destination, "pkg")
         files = os.listdir(pkgdest)
         self.assertTrue("__init__.py" in files)
-        self.assertTrue("__init__.pyc" in files)
+        if not sys.dont_write_bytecode:
+            self.assertTrue("__init__.pyc" in files)
         self.assertTrue("README.txt" in files)
 
     def test_empty_package_dir (self):
diff --git a/Lib/packaging/tests/test_command_build_py.py b/Lib/packaging/tests/test_command_build_py.py
--- a/Lib/packaging/tests/test_command_build_py.py
+++ b/Lib/packaging/tests/test_command_build_py.py
@@ -61,7 +61,8 @@
         pkgdest = os.path.join(destination, "pkg")
         files = os.listdir(pkgdest)
         self.assertIn("__init__.py", files)
-        self.assertIn("__init__.pyc", files)
+        if not sys.dont_write_bytecode:
+            self.assertIn("__init__.pyc", files)
         self.assertIn("README.txt", files)
 
     def test_empty_package_dir(self):
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -153,6 +153,9 @@
 Library
 -------
 
+- Issue #12120, #12119: skip a test in packaging and distutils
+  if sys.dont_write_bytecode is set to True.
+
 - Issue #12065: connect_ex() on an SSL socket now returns the original errno
   when the socket's timeout expires (it used to return None).
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list