Skip to content

test_enum fails when run with -OO #115252

Closed
Closed

Description

@sobolevn

Bug report

» ./python.exe -OO -m test test_enum
Using random seed: 918426150
0:00:00 load avg: 2.87 Run 1 test sequentially
0:00:00 load avg: 2.87 [1/1] test_enum
test test_enum failed -- Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_enum.py", line 4931, in test_pydoc
    self.assertEqual(result, expected_text, result)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'Help[234 chars]n |  CYAN = <Color.CYAN: 1>\n |\n |  MAGENTA =[658 chars]rs__' != 'Help[234 chars]n |  YELLOW = <Color.YELLOW: 3>\n |\n |  MAGEN[361 chars]rs__'
  Help on class Color in module test.test_enum:
  
  class Color(enum.Enum)
   |  Color(*values)
   |
   |  Method resolution order:
   |      Color
   |      enum.Enum
   |      builtins.object
   |
   |  Data and other attributes defined here:
   |
-  |  CYAN = <Color.CYAN: 1>
+  |  YELLOW = <Color.YELLOW: 3>
   |
   |  MAGENTA = <Color.MAGENTA: 2>
   |
-  |  YELLOW = <Color.YELLOW: 3>
+  |  CYAN = <Color.CYAN: 1>
   |
   |  ----------------------------------------------------------------------
   |  Data descriptors inherited from enum.Enum:
   |
   |  name
   |
   |  value
   |
   |  ----------------------------------------------------------------------
-  |  Methods inherited from enum.EnumType:
?     ^  - ^
+  |  Data descriptors inherited from enum.EnumType:
?     ^^^^^^ +++++  ^
-  |
-  |  __contains__(value) from enum.EnumType
-  |
-  |  __getitem__(name) from enum.EnumType
-  |
-  |  __iter__() from enum.EnumType
-  |
-  |  __len__() from enum.EnumType
-  |
-  |  ----------------------------------------------------------------------
-  |  Readonly properties inherited from enum.EnumType:
   |
   |  __members__
 : Help on class Color in module test.test_enum:

class Color(enum.Enum)
 |  Color(*values)
 |
 |  Method resolution order:
 |      Color
 |      enum.Enum
 |      builtins.object
 |
 |  Data and other attributes defined here:
 |
 |  CYAN = <Color.CYAN: 1>
 |
 |  MAGENTA = <Color.MAGENTA: 2>
 |
 |  YELLOW = <Color.YELLOW: 3>
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from enum.Enum:
 |
 |  name
 |
 |  value
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from enum.EnumType:
 |
 |  __contains__(value) from enum.EnumType
 |
 |  __getitem__(name) from enum.EnumType
 |
 |  __iter__() from enum.EnumType
 |
 |  __len__() from enum.EnumType
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties inherited from enum.EnumType:
 |
 |  __members__

test_enum failed (1 failure)

== Tests result: FAILURE ==

1 test failed:
    test_enum

Total duration: 831 ms
Total tests: run=1,068 failures=1 skipped=4
Total test files: run=1/1 failed=1
Result: FAILURE

I have a PR ready.

Linked PRs

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    testsTests in the Lib/test dir
    on Feb 10, 2024
  2. self-assigned this
    on Feb 10, 2024
  3. added a commit that references this issue on Feb 10, 2024
  4. added a commit that references this issue on Feb 10, 2024
  5. changed the title [-]`test_enum` fails when run with `-00`[/-] [+]`test_enum` fails when run with `-OO`[/+] on Feb 10, 2024
  6. added a commit that references this issue on Feb 10, 2024
  7. added a commit that references this issue on Feb 11, 2024
  8. added 2 commits that reference this issue on Feb 11, 2024
  9. added 2 commits that reference this issue on Feb 12, 2024
  10. added a commit that references this issue on Feb 13, 2024
  11. added 3 commits that reference this issue on Feb 13, 2024
  12. added 2 commits that reference this issue on Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

testsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions