This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test.test_ssl.TestEnumerations is not run
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, ethan.furman, serhiy.storchaka, sobolevn
Priority: normal Keywords: patch

Created on 2021-09-13 20:14 by serhiy.storchaka, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 28330 merged sobolevn, 2021-09-14 11:54
Messages (4)
msg401723 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-09-13 20:14
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'

----------------------------------------------------------------------
msg401777 - (view) Author: Nikita Sobolev (sobolevn) * (Python triager) Date: 2021-09-14 11:34
Looks like `TestEnumerations` was never added to `tests` in `test_main`. https://github.com/python/cpython/commit/a02cb474f9c097c83cd444a47e9fb5f99b4aaf45#diff-d526ded1c360bed6b222de46f4ca92b834f978ebed992fb3189bf9a94a198578R4702

I will try to enable it and fix failures.
msg401856 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-09-15 16:57
New changeset d897579a80da3f4572d96501c41bec6cacb10d84 by Nikita Sobolev in branch 'main':
bpo-45185: enables `TestEnumerations` in `test_ssl` (GH-28330)
https://github.com/python/cpython/commit/d897579a80da3f4572d96501c41bec6cacb10d84
msg401857 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-09-15 17:00
Thank you Nikita!

The test was added in issue38659 and was not backported, so it is 3.11 only issue.
History
Date User Action Args
2022-04-11 14:59:49adminsetgithub: 89348
2021-09-17 07:45:32serhiy.storchakalinkissue45229 dependencies
2021-09-15 17:00:40serhiy.storchakasetstatus: open -> closed
versions: - Python 3.9, Python 3.10
messages: + msg401857

resolution: fixed
stage: patch review -> resolved
2021-09-15 16:57:10serhiy.storchakasetmessages: + msg401856
2021-09-14 11:54:51sobolevnsetkeywords: + patch
stage: patch review
pull_requests: + pull_request26741
2021-09-14 11:34:37sobolevnsetnosy: + sobolevn
messages: + msg401777
2021-09-13 20:22:37ethan.furmansetnosy: + ethan.furman
2021-09-13 20:14:35serhiy.storchakacreate