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

Increase test coverage in dis module #55768

Closed
matiasb mannequin opened this issue Mar 15, 2011 · 4 comments
Closed

Increase test coverage in dis module #55768

matiasb mannequin opened this issue Mar 15, 2011 · 4 comments
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@matiasb
Copy link
Mannequin

matiasb mannequin commented Mar 15, 2011

BPO 11559
Nosy @ncoghlan, @benjaminp
Files
  • add_dis_tests.patch: Updates for test_dis tests
  • updated_add_dis_tests.patch: Updated patch
  • 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 = None
    closed_at = <Date 2011-03-15.19:43:45.882>
    created_at = <Date 2011-03-15.18:50:26.016>
    labels = ['type-bug', 'tests']
    title = 'Increase test coverage in dis module'
    updated_at = <Date 2011-03-15.19:43:45.881>
    user = 'https://bugs.python.org/matiasb'

    bugs.python.org fields:

    activity = <Date 2011-03-15.19:43:45.881>
    actor = 'python-dev'
    assignee = 'none'
    closed = True
    closed_date = <Date 2011-03-15.19:43:45.882>
    closer = 'python-dev'
    components = ['Tests']
    creation = <Date 2011-03-15.18:50:26.016>
    creator = 'matiasb'
    dependencies = []
    files = ['21224', '21225']
    hgrepos = []
    issue_num = 11559
    keywords = ['patch']
    message_count = 4.0
    messages = ['131018', '131021', '131024', '131029']
    nosy_count = 4.0
    nosy_names = ['ncoghlan', 'benjamin.peterson', 'python-dev', 'matiasb']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue11559'
    versions = ['Python 3.3']

    @matiasb
    Copy link
    Mannequin Author

    matiasb mannequin commented Mar 15, 2011

    Attaching patch to add new tests for dis module.

    @matiasb matiasb mannequin added tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Mar 15, 2011
    @benjaminp
    Copy link
    Contributor

    1. Use splitlines() instead of split('\n')
    2. Use try finally when replacing sys.stdout.
    3. Why is dist(None) a RuntimeError and anything else invalid TypeError?

    @matiasb
    Copy link
    Mannequin Author

    matiasb mannequin commented Mar 15, 2011

    Updated patch following Benjamin advice (1. and 2.).

    Re 3. Why is dist(None) a RuntimeError and anything else invalid TypeError?

    When the dis argument is None, the last traceback is disassembled; if something different to None and that does not have code (ie. no class, method, function or bytecode) is passed, the TypeError exception is raised [0].

    [0] http://hg.python.org/cpython/file/1c0cded97280/Lib/dis.py#l28

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Mar 15, 2011

    New changeset f41c3d9e05bd by Benjamin Peterson in branch 'default':
    improve dis test coverage (closes bpo-11559)
    http://hg.python.org/cpython/rev/f41c3d9e05bd

    @python-dev python-dev mannequin closed this as completed Mar 15, 2011
    @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

    1 participant