Skip to content

test_descr fails when run with -OO #115249

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

Closed
sobolevn opened this issue Feb 10, 2024 · 1 comment
Closed

test_descr fails when run with -OO #115249

sobolevn opened this issue Feb 10, 2024 · 1 comment
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

Output:

» ./python.exe -OO -m test test_descr
Using random seed: 1321086896
0:00:00 load avg: 3.34 Run 1 test sequentially
0:00:00 load avg: 3.34 [1/1] test_descr
test test_descr failed -- Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/test/test_descr.py", line 1601, in test_classmethods
    self.assertEqual(cm.__dict__, cm_dict)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
AssertionError: {'__module__': 'test.test_descr', '__name__':[114 chars]: {}} != {'__annotations__': {}, '__doc__': 'f docstri[123 chars]>.f'}
  {'__annotations__': {},
-  '__doc__': None,
+  '__doc__': 'f docstring',
   '__module__': 'test.test_descr',
   '__name__': 'f',
   '__qualname__': 'ClassPropertiesAndMethods.test_classmethods.<locals>.f'}

test_descr failed (1 failure)

== Tests result: FAILURE ==

1 test failed:
    test_descr

Total duration: 353 ms
Total tests: run=156 failures=1 skipped=2
Total test files: run=1/1 failed=1
Result: FAILURE

I have a fix 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
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 11, 2024
(cherry picked from commit 1f23837)

Co-authored-by: Nikita Sobolev <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 11, 2024
(cherry picked from commit 1f23837)

Co-authored-by: Nikita Sobolev <[email protected]>
sobolevn added a commit that referenced this issue Feb 11, 2024
gh-115249: Fix `test_descr` with `-OO` mode (GH-115250)
(cherry picked from commit 1f23837)

Co-authored-by: Nikita Sobolev <[email protected]>
sobolevn added a commit that referenced this issue Feb 11, 2024
gh-115249: Fix `test_descr` with `-OO` mode (GH-115250)
(cherry picked from commit 1f23837)

Co-authored-by: Nikita Sobolev <[email protected]>
@sobolevn
Copy link
Member Author

Done!

fsc-eriker pushed a commit to fsc-eriker/cpython that referenced this issue Feb 14, 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