You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make testsuite pass with -B/DONTWRITEBYTECODE set. #55629
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 bpo-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.)
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.
Activity
Yhg1s commentedon Mar 6, 2011
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 bpo-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.)
Yhg1s commentedon Mar 7, 2011
As per issue bpo-11417, updated to also skip the tests in distutils/tests/test_bdist_rpm.py when not writing bytecode.
ezio-melotti commentedon Mar 14, 2013
Attached an updated patch against 3.2.
berkerpeksag commentedon Mar 14, 2013
+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?
ezio-melotti commentedon Mar 14, 2013
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.
merwok commentedon Mar 16, 2013
Looks fine.
Can this go into 2.7 too?
python-dev commentedon Mar 16, 2013
New changeset 2370ae9ee052 by Ezio Melotti in branch '3.2':
bpo-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':
bpo-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':
bpo-11420: merge with 3.2.
http://hg.python.org/cpython/rev/5aa5bebcd768
New changeset 0a15a58ac4a1 by Ezio Melotti in branch 'default':
bpo-11420: merge with 3.3.
http://hg.python.org/cpython/rev/0a15a58ac4a1
ezio-melotti commentedon Mar 16, 2013
This should be fixed now.