Skip to content

test_enum broken for WASI under Python 3.11 #111797

Closed

Description

@brettcannon

Bug report

Bug description:

https://buildbot.python.org/all/#/builders/1047/builds/1074

======================================================================
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'
----------------------------------------------------------------------

CPython versions tested on:

3.11

Operating systems tested on:

Other

Linked PRs

Activity

  1. brettcannon commented on Nov 6, 2023

    @brettcannon
    MemberAuthor

    Caused by #111617 .

  2. brettcannon commented on Nov 6, 2023

    @brettcannon
    MemberAuthor
  3. ethanfurman commented on Nov 6, 2023

    @ethanfurman
    Member

    How did that PR pass the checks?

  4. added a commit that references this issue on Nov 7, 2023
  5. brettcannon commented on Nov 7, 2023

    @brettcannon
    MemberAuthor

    @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.

  6. ethanfurman commented on Nov 7, 2023

    @ethanfurman
    Member

    I actually meant the original 3.11 patch, whose doctest portion fails because of that extra line. Oh well. It's fixed now.

  7. brettcannon commented on Nov 7, 2023

    @brettcannon
    MemberAuthor
  8. brettcannon commented on Nov 7, 2023

    @brettcannon
    MemberAuthor

    I actually meant the original 3.11 patch, whose doctest portion fails because of that extra line.

    Beats me. Doctest is still slightly magical to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-wasitype-bugAn unexpected behavior, bug, or error

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions