Content-Length: 268562 | pFad | http://github.com/python/cpython/pull/136478

D5 gh-136438: Make sure `test_compile` pass with all optimization levels by donBarbos · Pull Request #136478 · python/cpython · GitHub
Skip to content

gh-136438: Make sure test_compile pass with all optimization levels #136478

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

donBarbos
Copy link
Contributor

@donBarbos donBarbos commented Jul 9, 2025

output before:

======================================================================
ERROR: test_compile_ast (test.test_compile.TestSpecifics.test_compile_ast)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../cpython/Lib/test/test_compile.py", line 597, in test_compile_ast
    co2 = compile(ast, '%s3' % fname, 'exec')
ValueError: empty body on FunctionDef

======================================================================
FAIL: test_remove_unused_consts (test.test_compile.TestSpecifics.test_remove_unused_consts)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../cpython/Lib/test/test_compile.py", line 826, in test_remove_unused_consts
    self.assertEqual(f.__code__.co_consts,
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
                     (f.__doc__, "used"))
                     ^^^^^^^^^^^^^^^^^^^^
AssertionError: Tuples differ: (True, 'used') != (None, 'used')

First differing element 0:
True
None

- (True, 'used')
?  ^^^

+ (None, 'used')
?  ^^^


======================================================================
FAIL: test_strip_unused_None (test.test_compile.TestSpecifics.test_strip_unused_None)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../cpython/Lib/test/test_compile.py", line 872, in test_strip_unused_None
    self.assertEqual(f1.__code__.co_consts, (f1.__doc__,))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Tuples differ: (42,) != (None,)

First differing element 0:
42
None

- (42,)
+ (None,)

----------------------------------------------------------------------

@bedevere-app bedevere-app bot added awaiting review tests Tests in the Lib/test dir labels Jul 9, 2025
@bedevere-app bedevere-app bot mentioned this pull request Jul 9, 2025
8 tasks
@StanFromIreland StanFromIreland requested a review from sobolevn July 10, 2025 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/python/cpython/pull/136478

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy