classification
Title: Test failures when running with PYTHONDONTWRITEBYTECODE
Type: Stage: resolved
Components: Tests Versions: Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: Rosuav, berker.peksag, brett.cannon, python-dev
Priority: normal Keywords: patch

Created on 2014-02-27 14:32 by Rosuav, last changed 2014-02-27 18:53 by Rosuav. This issue is now closed.

Files
File name Uploaded Description Edit
issue20796.diff berker.peksag, 2014-02-27 16:40 review
issue20796_v2.diff berker.peksag, 2014-02-27 16:54 review
Messages (6)
msg212356 - (view) Author: Chris Angelico (Rosuav) * Date: 2014-02-27 14:32
$ find . -name \*.pyc -delete
$ PYTHONDONTWRITEBYTECODE=1 make test

Three test failures, which all seem to be duplicates of:

======================================================================
FAIL: test_timestamp_overflow (test.test_importlib.source.test_file_loader.Source_SimpleTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/rosuav/cpython/Lib/test/test_importlib/source/test_file_loader.py", line 215, in test_timestamp_overflow
    self.assertTrue(os.path.exists(compiled))
AssertionError: False is not true

----------------------------------------------------------------------


It goes looking for the .pyc cached file, does not find it, and fails. Test should probably be skipped if bytecode isn't being written.
msg212365 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2014-02-27 16:40
Here's a patch to skip the test if PYTHONDONTWRITEBYTECODE is not None.
msg212370 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2014-02-27 16:54
Updated patch adressing Brett's comment. Thanks!
msg212372 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2014-02-27 17:30
LGTM; I (or some other core dev) will commit when there's time.
msg212373 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-02-27 18:50
New changeset 8afcfe6dfd6e by Benjamin Peterson in branch '3.3':
fix importlib test failure when bytecode writing is disabled (closes #20796)
http://hg.python.org/cpython/rev/8afcfe6dfd6e

New changeset 15a0bbfb27f1 by Benjamin Peterson in branch 'default':
merge 3.3 (#20796)
http://hg.python.org/cpython/rev/15a0bbfb27f1
msg212374 - (view) Author: Chris Angelico (Rosuav) * Date: 2014-02-27 18:53
Thanks for the fast turn-around, guys! Not that it matters hugely - I happened to have bytecode writing disabled to test something unrelated and noticed the test failure.
History
Date User Action Args
2014-02-27 18:53:11Rosuavsetmessages: + msg212374
2014-02-27 18:50:37python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg212373

resolution: fixed
stage: commit review -> resolved
2014-02-27 17:30:22brett.cannonsetmessages: + msg212372
stage: patch review -> commit review
2014-02-27 16:54:17berker.peksagsetfiles: + issue20796_v2.diff

messages: + msg212370
stage: patch review
2014-02-27 16:49:07brett.cannonsetassignee: brett.cannon

nosy: + brett.cannon
2014-02-27 16:40:30berker.peksagsetfiles: + issue20796.diff

nosy: + berker.peksag
messages: + msg212365

keywords: + patch
2014-02-27 14:32:33Rosuavsetcomponents: + Tests
versions: + Python 3.4
2014-02-27 14:32:17Rosuavcreate