classification
Title: Make testsuite pass with -B/DONTWRITEBYTECODE set.
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.4, Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ezio.melotti Nosy List: barry, berker.peksag, eric.araujo, ezio.melotti, ncoghlan, python-dev, twouters
Priority: normal Keywords: patch

Created on 2011-03-06 23:48 by twouters, last changed 2013-03-16 19:51 by ezio.melotti. This issue is now closed.

Files
File name Uploaded Description Edit
py31-dontwritebytecode.diff twouters, 2011-03-07 19:00
py32-dontwritebytecode.diff twouters, 2011-03-07 19:00
issue11420.diff ezio.melotti, 2013-03-14 04:18 Patch against 3.2.
Messages (8)
msg130204 - (view) Author: Thomas Wouters (twouters) * (Python committer) Date: 2011-03-06 23:48
This patch tweaks a few tests that currently rely on .pyc files being written, causing them to fail (or crash) when running 'make test TESTPYTHONOPTS=-B'. All these are purely test failures, not failures in the tested code (unlike issue #11417, which is a failure in bdist_rpm instead of the test.)

(This patch is for 3.1; the patch for 3.2/default is slightly different. I also have the same patch for Python 2.6/2.7, but I'm not sure if it's worth applying.)
msg130283 - (view) Author: Thomas Wouters (twouters) * (Python committer) Date: 2011-03-07 19:00
As per issue #11417, updated to also skip the tests in distutils/tests/test_bdist_rpm.py when not writing bytecode.
msg184131 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-03-14 04:18
Attached an updated patch against 3.2.
msg184159 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2013-03-14 11:39
+skip_if_dont_write_bytecode = unittest.skipIf(
+        sys.dont_write_bytecode,
+        "test meaningful only when writing bytecode")

Maybe this could be added to the test.support module?
msg184205 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-03-14 22:50
There are a couple more tests elsewhere that use @skipIf(sys.dont_write_bytecode, ...) directly, but I don't think it's generic enough to be moved to test.support.
msg184281 - (view) Author: √Čric Araujo (eric.araujo) * (Python committer) Date: 2013-03-16 01:33
Looks fine.

Can this go into 2.7 too?
msg184346 - (view) Author: Roundup Robot (python-dev) Date: 2013-03-16 19:50
New changeset 2370ae9ee052 by Ezio Melotti in branch '3.2':
#11420: make test suite pass with -B/DONTWRITEBYTECODE set.  Initial patch by Thomas Wouters.
http://hg.python.org/cpython/rev/2370ae9ee052

New changeset c70746a0291f by Ezio Melotti in branch '2.7':
#11420: make test suite pass with -B/DONTWRITEBYTECODE set.  Initial patch by Thomas Wouters.
http://hg.python.org/cpython/rev/c70746a0291f

New changeset 5aa5bebcd768 by Ezio Melotti in branch '3.3':
#11420: merge with 3.2.
http://hg.python.org/cpython/rev/5aa5bebcd768

New changeset 0a15a58ac4a1 by Ezio Melotti in branch 'default':
#11420: merge with 3.3.
http://hg.python.org/cpython/rev/0a15a58ac4a1
msg184347 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-03-16 19:51
This should be fixed now.
History
Date User Action Args
2013-03-16 19:51:38ezio.melottisetstatus: open -> closed
versions: + Python 2.7
messages: + msg184347

assignee: ezio.melotti
resolution: fixed
stage: patch review -> resolved
2013-03-16 19:50:35python-devsetnosy: + python-dev
messages: + msg184346
2013-03-16 01:33:27eric.araujosetnosy: + eric.araujo
messages: + msg184281
2013-03-14 22:50:16ezio.melottisetmessages: + msg184205
2013-03-14 11:39:11berker.peksagsetnosy: + berker.peksag
messages: + msg184159
2013-03-14 04:18:54ezio.melottisetfiles: + issue11420.diff
versions: + Python 3.4, - Python 3.1
nosy: + ezio.melotti

messages: + msg184131

type: behavior
2011-03-07 20:01:57eric.araujolinkissue11417 superseder
2011-03-07 19:00:49twouterssetfiles: + py32-dontwritebytecode.diff
nosy: twouters, barry, ncoghlan
2011-03-07 19:00:35twouterssetfiles: + py31-dontwritebytecode.diff
nosy: twouters, barry, ncoghlan
messages: + msg130283
2011-03-07 18:59:54twouterssetfiles: - py32-dontwritebytecode.diff
nosy: twouters, barry, ncoghlan
2011-03-07 18:59:49twouterssetfiles: - py31-dontwritebytecode.diff
nosy: twouters, barry, ncoghlan
2011-03-06 23:50:03pitrousetnosy: + barry, ncoghlan

stage: patch review
2011-03-06 23:48:57twouterssetfiles: + py32-dontwritebytecode.diff
2011-03-06 23:48:08twouterscreate