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

Make testsuite pass with -B/DONTWRITEBYTECODE set. #55629

Closed
Yhg1s opened this issue Mar 6, 2011 · 8 comments
Closed

Make testsuite pass with -B/DONTWRITEBYTECODE set. #55629

Yhg1s opened this issue Mar 6, 2011 · 8 comments
Assignees
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@Yhg1s
Copy link
Member

Yhg1s commented Mar 6, 2011

BPO 11420
Nosy @Yhg1s, @warsaw, @ncoghlan, @ezio-melotti, @merwok, @berkerpeksag
Files
  • py31-dontwritebytecode.diff
  • py32-dontwritebytecode.diff
  • issue11420.diff: Patch against 3.2.
  • 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/ezio-melotti'
    closed_at = <Date 2013-03-16.19:51:38.169>
    created_at = <Date 2011-03-06.23:48:08.810>
    labels = ['type-bug', 'tests']
    title = 'Make testsuite pass with -B/DONTWRITEBYTECODE set.'
    updated_at = <Date 2013-03-16.19:51:38.167>
    user = 'https://github.com/Yhg1s'

    bugs.python.org fields:

    activity = <Date 2013-03-16.19:51:38.167>
    actor = 'ezio.melotti'
    assignee = 'ezio.melotti'
    closed = True
    closed_date = <Date 2013-03-16.19:51:38.169>
    closer = 'ezio.melotti'
    components = ['Tests']
    creation = <Date 2011-03-06.23:48:08.810>
    creator = 'twouters'
    dependencies = []
    files = ['21036', '21037', '29405']
    hgrepos = []
    issue_num = 11420
    keywords = ['patch']
    message_count = 8.0
    messages = ['130204', '130283', '184131', '184159', '184205', '184281', '184346', '184347']
    nosy_count = 7.0
    nosy_names = ['twouters', 'barry', 'ncoghlan', 'ezio.melotti', 'eric.araujo', 'python-dev', 'berker.peksag']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue11420'
    versions = ['Python 2.7', 'Python 3.2', 'Python 3.3', 'Python 3.4']

    @Yhg1s
    Copy link
    Member Author

    Yhg1s commented 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 Yhg1s added the tests Tests in the Lib/test dir label Mar 6, 2011
    @Yhg1s
    Copy link
    Member Author

    Yhg1s commented 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
    Copy link
    Member

    Attached an updated patch against 3.2.

    @ezio-melotti ezio-melotti added the type-bug An unexpected behavior, bug, or error label Mar 14, 2013
    @berkerpeksag
    Copy link
    Member

    +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
    Copy link
    Member

    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
    Copy link
    Member

    merwok commented Mar 16, 2013

    Looks fine.

    Can this go into 2.7 too?

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented 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
    Copy link
    Member

    This should be fixed now.

    @ezio-melotti ezio-melotti self-assigned this Mar 16, 2013
    @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 type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants