Skip to content

gh-136438: Make sure test_ast pass with all optimization levels #136596

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

Merged
merged 3 commits into from
Jul 18, 2025

Conversation

efimov-mikhail
Copy link
Contributor

@efimov-mikhail efimov-mikhail commented Jul 12, 2025

Now tests pass with all combinations of -OO and --without-doc-strings.
It was long lists of errors before, but all proposed fixes are just to add some needed optimize=False options.

@bedevere-app bedevere-app bot mentioned this pull request Jul 12, 2025
8 tasks
@bedevere-app bedevere-app bot added the tests Tests in the Lib/test dir label Jul 12, 2025
@Eclips4
Copy link
Member

Eclips4 commented Jul 17, 2025

I believe the explanation is as follows:
If the optimize parameter isn’t passed explicitly, the interpreter uses its internal setting (which can be modified using the -O or -OO flags).
Am I right, @efimov-mikhail?

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
@efimov-mikhail
Copy link
Contributor Author

efimov-mikhail commented Jul 17, 2025

If the optimize parameter isn’t passed explicitly, the interpreter uses its internal setting (which can be modified using the -O or -OO flags).

Exactly. I've added checks only in those tests that fail with -OO. We now force to run ast.parse and compile without optimizations to be sure that their results don't depend on runtime flags.

@Eclips4 Eclips4 merged commit 03017a8 into python:main Jul 18, 2025
40 checks passed
@Eclips4
Copy link
Member

Eclips4 commented Jul 18, 2025

Thank you @efimov-mikhail!

@efimov-mikhail
Copy link
Contributor Author

Thx for merge, @Eclips4 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy