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

Fix test_html_doc in test_pydoc #91198

Closed
serhiy-storchaka opened this issue Mar 17, 2022 · 3 comments
Closed

Fix test_html_doc in test_pydoc #91198

serhiy-storchaka opened this issue Mar 17, 2022 · 3 comments
Labels
3.11 only security fixes tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

BPO 47042
Nosy @serhiy-storchaka
PRs
  • bpo-47042: Fix testing the HTML output in test_pydoc #31959
  • 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 2022-03-18.12:15:42.105>
    created_at = <Date 2022-03-17.10:57:10.093>
    labels = ['type-bug', 'tests', '3.11']
    title = 'Fix test_html_doc in test_pydoc'
    updated_at = <Date 2022-03-18.12:15:42.103>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2022-03-18.12:15:42.103>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2022-03-18.12:15:42.105>
    closer = 'serhiy.storchaka'
    components = ['Tests']
    creation = <Date 2022-03-17.10:57:10.093>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 47042
    keywords = ['patch']
    message_count = 3.0
    messages = ['415396', '415426', '415488']
    nosy_count = 1.0
    nosy_names = ['serhiy.storchaka']
    pr_nums = ['31959']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue47042'
    versions = ['Python 3.11']

    @serhiy-storchaka
    Copy link
    Member Author

    Due to missed splitlines() in test_pydoc the HTML output was not tested correctly. Instead of testing that the actual output contains every *line* from the expected output it tested that the actual output contains every *character* from the expected output. The test would pass with any actual output which contains all Latin letters and some punctuation.

    The following PR fixes this bug and makes the test even more strict. Now it tests that the actual output contains the same lines as the expected output, in the same order, ignoring indentation and empty lines.

    @serhiy-storchaka serhiy-storchaka added 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Mar 17, 2022
    @serhiy-storchaka
    Copy link
    Member Author

    New changeset a5d2460 by Serhiy Storchaka in branch 'main':
    bpo-47042: Fix testing the HTML output in test_pydoc (GH-31959)
    a5d2460

    @serhiy-storchaka
    Copy link
    Member Author

    It is 3.11 only issue.

    @serhiy-storchaka serhiy-storchaka removed 3.9 only security fixes 3.10 only security fixes labels Mar 18, 2022
    @serhiy-storchaka serhiy-storchaka removed 3.9 only security fixes 3.10 only security fixes labels Mar 18, 2022
    @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
    3.11 only security fixes 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