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_enum fails when run with -OO #115252

Closed
sobolevn opened this issue Feb 10, 2024 · 0 comments
Closed

test_enum fails when run with -OO #115252

sobolevn opened this issue Feb 10, 2024 · 0 comments
Assignees
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

sobolevn commented Feb 10, 2024

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

@sobolevn sobolevn added type-bug An unexpected behavior, bug, or error tests Tests in the Lib/test dir labels Feb 10, 2024
@sobolevn sobolevn self-assigned this Feb 10, 2024
sobolevn added a commit to sobolevn/cpython that referenced this issue Feb 10, 2024
@ethanfurman ethanfurman changed the title test_enum fails when run with -00 test_enum fails when run with -OO Feb 10, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 10, 2024
(cherry picked from commit 33f56b7)

Co-authored-by: Nikita Sobolev <[email protected]>
ethanfurman pushed a commit that referenced this issue Feb 11, 2024
)

(cherry picked from commit 33f56b7)

Co-authored-by: Nikita Sobolev <[email protected]>
sobolevn added a commit to sobolevn/cpython that referenced this issue Feb 11, 2024
sobolevn added a commit that referenced this issue Feb 11, 2024
(cherry picked from commit 33f56b7)

Co-authored-by: Nikita Sobolev <[email protected]>
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Feb 12, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 13, 2024
(cherry picked from commit ca3604a)

Co-authored-by: Serhiy Storchaka <[email protected]>
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Feb 13, 2024
serhiy-storchaka added a commit that referenced this issue Feb 13, 2024
fsc-eriker pushed a commit to fsc-eriker/cpython that referenced this issue Feb 14, 2024
@sobolevn sobolevn closed this as completed Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant