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.test_ssl.TestEnumerations is not run #89348

Closed
serhiy-storchaka opened this issue Sep 13, 2021 · 4 comments
Closed

test.test_ssl.TestEnumerations is not run #89348

serhiy-storchaka opened this issue Sep 13, 2021 · 4 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 45185
Nosy @tiran, @ethanfurman, @serhiy-storchaka, @sobolevn
PRs
  • bpo-45185: enables TestEnumerations in test_ssl #28330
  • 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 2021-09-15.17:00:40.451>
    created_at = <Date 2021-09-13.20:14:35.310>
    labels = ['type-bug', 'tests', '3.11']
    title = 'test.test_ssl.TestEnumerations is not run'
    updated_at = <Date 2021-09-15.17:00:40.451>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2021-09-15.17:00:40.451>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-09-15.17:00:40.451>
    closer = 'serhiy.storchaka'
    components = ['Tests']
    creation = <Date 2021-09-13.20:14:35.310>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 45185
    keywords = ['patch']
    message_count = 4.0
    messages = ['401723', '401777', '401856', '401857']
    nosy_count = 4.0
    nosy_names = ['christian.heimes', 'ethan.furman', 'serhiy.storchaka', 'sobolevn']
    pr_nums = ['28330']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue45185'
    versions = ['Python 3.11']

    @serhiy-storchaka
    Copy link
    Member Author

    test.test_ssl.TestEnumerations is not run when run ssl tests. If add it to the list of test classes it fails:

    ======================================================================
    ERROR: test_options (test.test_ssl.TestEnumerations)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/serhiy/py/cpython/Lib/test/test_ssl.py", line 4981, in test_options
        enum._test_simple_enum(CheckedOptions, ssl.Options)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/serhiy/py/cpython/Lib/enum.py", line 1803, in _test_simple_enum
        raise TypeError('enum mismatch:\n   %s' % '\n   '.join(failed))
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    TypeError: enum mismatch:
       '_use_args_':
             checked -> False
             simple  -> True
       '__format__':  checked -> <function Enum.__format__ at 0x7f18691815a0> simple -> <function IntFlag.__format__ at 0x7f1869182620>
       '__getnewargs__':  checked -> None                simple -> <method '__getnewargs__' of 'int' objects>

    ======================================================================
    ERROR: test_sslerrornumber (test.test_ssl.TestEnumerations)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/serhiy/py/cpython/Lib/test/test_ssl.py", line 4998, in test_sslerrornumber
        enum._test_simple_enum(Checked_SSLMethod, ssl._SSLMethod)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/serhiy/py/cpython/Lib/enum.py", line 1803, in _test_simple_enum
        raise TypeError('enum mismatch:\n   %s' % '\n   '.join(failed))
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    TypeError: enum mismatch:
       extra key:   'PROTOCOL_SSLv23'

    ======================================================================
    ERROR: test_sslmethod (test.test_ssl.TestEnumerations)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/serhiy/py/cpython/Lib/test/test_ssl.py", line 4973, in test_sslmethod
        enum._test_simple_enum(Checked_SSLMethod, ssl._SSLMethod)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/serhiy/py/cpython/Lib/enum.py", line 1803, in _test_simple_enum
        raise TypeError('enum mismatch:\n   %s' % '\n   '.join(failed))
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    TypeError: enum mismatch:
       extra key:   'PROTOCOL_SSLv23'

    ======================================================================
    ERROR: test_verifyflags (test.test_ssl.TestEnumerations)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/serhiy/py/cpython/Lib/test/test_ssl.py", line 5002, in test_verifyflags
        enum.FlagEnum, 'VerifyFlags', 'ssl',
        ^^^^^^^^^^^^^
    AttributeError: module 'enum' has no attribute 'FlagEnum'

    @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 Sep 13, 2021
    @sobolevn
    Copy link
    Member

    Looks like TestEnumerations was never added to tests in test_main. a02cb47#diff-d526ded1c360bed6b222de46f4ca92b834f978ebed992fb3189bf9a94a198578R4702

    I will try to enable it and fix failures.

    @serhiy-storchaka
    Copy link
    Member Author

    New changeset d897579 by Nikita Sobolev in branch 'main':
    bpo-45185: enables TestEnumerations in test_ssl (GH-28330)
    d897579

    @serhiy-storchaka
    Copy link
    Member Author

    Thank you Nikita!

    The test was added in bpo-38659 and was not backported, so it is 3.11 only issue.

    @serhiy-storchaka serhiy-storchaka removed 3.9 only security fixes 3.10 only security fixes labels Sep 15, 2021
    @serhiy-storchaka serhiy-storchaka removed 3.9 only security fixes 3.10 only security fixes labels Sep 15, 2021
    @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

    2 participants