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

Victor Stinner victor.stinner at haypocalc.com
Fri May 20 00:51:23 CEST 2011


Python 3.3 is not supposed to create .pyc files in the same directory than the .py files. So I don't understand the following code.

Le jeudi 19 mai 2011 à 19:56 +0200, tarek.ziade a écrit :

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.dontwritebytecode check

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

diff --git a/Lib/distutils/tests/testbuildpy.py b/Lib/distutils/tests/testbuildpy.py --- a/Lib/distutils/tests/testbuildpy.py +++ b/Lib/distutils/tests/testbuildpy.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.dontwritebytecode: + self.assertTrue("init.pyc" in files) self.assertTrue("README.txt" in files) def testemptypackagedir (self): diff --git a/Lib/packaging/tests/testcommandbuildpy.py b/Lib/packaging/tests/testcommandbuildpy.py --- a/Lib/packaging/tests/testcommandbuildpy.py +++ b/Lib/packaging/tests/testcommandbuildpy.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.dontwritebytecode: + self.assertIn("init.pyc", files) self.assertIn("README.txt", files) def testemptypackagedir(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.dontwritebytecode is set to True. + - Issue #12065: connectex() on an SSL socket now returns the original errno when the socket's timeout expires (it used to return None).


Python-checkins mailing list Python-checkins at python.org http://mail.python.org/mailman/listinfo/python-checkins



More information about the Python-Dev mailing list