Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failures when running with PYTHONDONTWRITEBYTECODE #64995

Closed
Rosuav opened this issue Feb 27, 2014 · 6 comments
Closed

Test failures when running with PYTHONDONTWRITEBYTECODE #64995

Rosuav opened this issue Feb 27, 2014 · 6 comments
Assignees
Labels
tests Tests in the Lib/test dir

Comments

@Rosuav
Copy link
Contributor

Rosuav commented Feb 27, 2014

BPO 20796
Nosy @brettcannon, @Rosuav, @berkerpeksag
Files
  • issue20796.diff
  • issue20796_v2.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/brettcannon'
    closed_at = <Date 2014-02-27.18:50:37.015>
    created_at = <Date 2014-02-27.14:32:17.726>
    labels = ['tests']
    title = 'Test failures when running with PYTHONDONTWRITEBYTECODE'
    updated_at = <Date 2014-02-27.18:53:11.672>
    user = 'https://github.com/Rosuav'

    bugs.python.org fields:

    activity = <Date 2014-02-27.18:53:11.672>
    actor = 'Rosuav'
    assignee = 'brett.cannon'
    closed = True
    closed_date = <Date 2014-02-27.18:50:37.015>
    closer = 'python-dev'
    components = ['Tests']
    creation = <Date 2014-02-27.14:32:17.726>
    creator = 'Rosuav'
    dependencies = []
    files = ['34246', '34247']
    hgrepos = []
    issue_num = 20796
    keywords = ['patch']
    message_count = 6.0
    messages = ['212356', '212365', '212370', '212372', '212373', '212374']
    nosy_count = 4.0
    nosy_names = ['brett.cannon', 'python-dev', 'Rosuav', 'berker.peksag']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue20796'
    versions = ['Python 3.4']

    @Rosuav
    Copy link
    Contributor Author

    Rosuav commented Feb 27, 2014

    $ 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.

    @Rosuav Rosuav added the tests Tests in the Lib/test dir label Feb 27, 2014
    @berkerpeksag
    Copy link
    Member

    Here's a patch to skip the test if PYTHONDONTWRITEBYTECODE is not None.

    @brettcannon brettcannon self-assigned this Feb 27, 2014
    @berkerpeksag
    Copy link
    Member

    Updated patch adressing Brett's comment. Thanks!

    @brettcannon
    Copy link
    Member

    LGTM; I (or some other core dev) will commit when there's time.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Feb 27, 2014

    New changeset 8afcfe6dfd6e by Benjamin Peterson in branch '3.3':
    fix importlib test failure when bytecode writing is disabled (closes bpo-20796)
    http://hg.python.org/cpython/rev/8afcfe6dfd6e

    New changeset 15a0bbfb27f1 by Benjamin Peterson in branch 'default':
    merge 3.3 (bpo-20796)
    http://hg.python.org/cpython/rev/15a0bbfb27f1

    @python-dev python-dev mannequin closed this as completed Feb 27, 2014
    @Rosuav
    Copy link
    Contributor Author

    Rosuav commented Feb 27, 2014

    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.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    tests Tests in the Lib/test dir
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants