You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test_enum broken for WASI under Python 3.11 #111797
======================================================================
FAIL: /Doc/howto/enum.rst
Doctest: enum.rst
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Lib/doctest.py", line 2239, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for enum.rst
File "/Doc/howto/enum.rst", line 0
----------------------------------------------------------------------
File "/Doc/howto/enum.rst", line 1395, in enum.rst
Failed example:
class Color(DuplicateFreeEnum):
RED = 1
GREEN = 2
BLUE = 3
GRENE = 2
Expected:
Traceback (most recent call last):
...
ValueError: aliases not allowed in DuplicateFreeEnum: 'GRENE' --> 'GREEN'
Error calling __set_name__ on '_proto_member' instance 'GRENE' in 'Color'
Got:
Traceback (most recent call last):
File "/Lib/doctest.py", line 1351, in __run
exec(compile(example.source, filename, "single",
File "<doctest enum.rst[160]>", line 1, in <module>
class Color(DuplicateFreeEnum):
File "/Lib/enum.py", line 566, in __new__
raise exc
File "/Lib/enum.py", line 275, in __set_name__
enum_member.__init__(*args)
File "<doctest enum.rst[159]>", line 7, in __init__
raise ValueError(
ValueError: aliases not allowed in DuplicateFreeEnum: 'GRENE' --> 'GREEN'
----------------------------------------------------------------------
@ethanfurman beats me. I'm not sure what cross-section of doctest, enum, and WASI would cause some output to not appear in the testing output to trigger the failure.
Activity
brettcannon commentedon Nov 6, 2023
Caused by #111617 .
brettcannon commentedon Nov 6, 2023
/cc @ethanfurman
ethanfurman commentedon Nov 6, 2023
How did that PR pass the checks?
[3.11] gh-111797: fix enum how-to (GH-111805)
brettcannon commentedon Nov 7, 2023
@ethanfurman beats me. I'm not sure what cross-section of doctest, enum, and WASI would cause some output to not appear in the testing output to trigger the failure.
ethanfurman commentedon Nov 7, 2023
I actually meant the original 3.11 patch, whose doctest portion fails because of that extra line. Oh well. It's fixed now.
brettcannon commentedon Nov 7, 2023
https://buildbot.python.org/all/#/builders/1047/builds/1079 shows it fixed. Thanks!
brettcannon commentedon Nov 7, 2023
Beats me. Doctest is still slightly magical to me.