GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Multiple tests fail with `-OO` · Issue #136438 · python/cpython

Multiple tests fail with -OO #136438

New issue
Copy link
New issue
Copy link
Closed
Closed
Multiple tests fail with -OO#136438
Copy link
Labels
pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedtestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@sobolevn
sobolevn
opened on Jul 8, 2025
Issue body actions

When you run ./python.exe -OO -m test MODULE_NAME at least these ones fail:

8 tests failed:
    test.test_pydoc.test_pydoc test_ast test_builtin test_compile
    test_dis test_generated_cases test_interpreters test_remote_pdb

In my opinion it would be easier to contribute one test fix at a time. Rebases and reviews will be simplier. So, contributions are welcome!

I will create a single PR just to show how this can be solved for new contributors.

  • test.test_pydoc.test_pydoc
  • test_ast
  • test_builtin, @sobolevn
  • test_compile
  • test_dis
  • test_generated_cases
  • test_interpreters
  • test_remote_pdb

Linked PRs

  • gh-136438: Make sure test_builtins pass with all optimization levels #136474
  • gh-136438: Make sure test_compile pass with all optimization levels #136478
  • gh-136438: Make sure test.test_pydoc.test_pydoc pass with all optimization levels #136479
  • [3.14] gh-136438: Make sure test_builtins pass with all optimization levels (GH-136474) #136496
  • gh-136438: Make sure test_interpreters pass with all optimization levels #136499
  • [3.13] gh-136438: Make sure test_builtins pass with all optimization levels (GH-136474) #136502
  • gh-136438: Make sure test_dis pass with all optimization levels #136593
  • gh-136438: Make sure test_generated_cases pass with all optimization levels #136594
  • gh-136438: Make sure test_ast pass with all optimization levels #136596
  • gh-136438: Make sure test_remote_pdb pass with all optimization levels #136788
  • [3.14] gh-136438: Make sure test_remote_pdb pass with all optimization levels (GH-136788) #136855

Activity

Next
  1. sobolevn
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    testsTests in the Lib/test dirTests in the Lib/test dir
    easy
    on Jul 8, 2025
  2. gvanrossum commented on Jul 8, 2025

    @gvanrossum
    gvanrossum
    on Jul 8, 2025
    Member
    More actions

    Does anybody actually care about running the tests with -OO?

    Reacted by Shantanu
    Reacted by Rakesh Asapanna and Prakash Sellathurai
  3. sobolevn commented on Jul 8, 2025

    @sobolevn
    sobolevn
    on Jul 8, 2025
    MemberAuthor
    More actions

    @gvanrossum we have a lot of special-casing around this feature in tests. I guess it is used by someone, otherwise, it would not be here at all.

    My usecase was to check that subinterpreters don't have any magic assert statements that are required as the part of the main logic. -OO allows me to disable them and run tests again to be sure that everything still works.

    I am not sure that this is a common use-case, though.

    Reacted by Rakesh Asapanna
  4. kodsurfer commented on Jul 8, 2025

    @kodsurfer
    kodsurfer
    on Jul 8, 2025
    Contributor
    More actions

    @sobolevn should we wait your example PR or find another way?

  5. sobolevn commented on Jul 8, 2025

    @sobolevn
    sobolevn
    on Jul 8, 2025
    MemberAuthor
    More actions

    @kodsurfer there's no rush :)

    Let's first discuss whether this is worth doing, because clearly Guido has more context than me. If this is a waste of time, I will just close the issue.

    Reacted by kodsurfer, Ilya Solin and Kirill Podoprigora
  6. picnixz commented on Jul 8, 2025

    @picnixz
    picnixz
    on Jul 8, 2025
    Member
    More actions

    FTR, I use -OO to remove expensive assertions when doing numerical optimizations so I would be interested in features working even in -OO.

    Now, I don't think it's useful to run tests in -OO but it is useful to know that what we test works in -OO as well.

  7. gvanrossum commented on Jul 8, 2025

    @gvanrossum
    gvanrossum
    on Jul 8, 2025
    Member
    More actions

    I don't actually have more context except that given what -OO does I would expect failures and think nothing of it (I have no desire to fix any of these).

    Moreover, I presume we're not going to make CI even slower or more expensive by running all tests with all three "optimization" levels, so even if you fix the failures above, there won't be any guarantee that in the future other tests won't break with -O or -OO.

    You could think of -OO as an unsupported platform.

    Then again, if a particular test failure with -OO bothers you and is easy to fix I won't stop you. It just doesn't feel like an important thing to care about.

    Reacted by sobolevn and Kirill Podoprigora
  8. sobolevn
    added 2 commits that reference this issue on Jul 9, 2025

    pythongh-136438: Make sure `test_builtins` pass with all optimization…

    e670cad

    gh-136438: Make sure `test_builtins` pass with all optimization levels (

    c176543
  9. miss-islington
    added a commit that references this issue on Jul 10, 2025

    pythongh-136438: Make sure `test_builtins` pass with all optimization…

    097755c
  10. sobolevn
    added a commit that references this issue on Jul 10, 2025

    [3.14] gh-136438: Make sure `test_builtins` pass with all optimizatio…

    2de82bc
  11. donbarbos
    added a commit that references this issue on Jul 10, 2025

    pythongh-136438: Make sure `test_interpreters` pass with all optimiza…

    b270064
  12. sobolevn
    added a commit that references this issue on Jul 10, 2025

    [3.13] pythongh-136438: Make sure `test_builtins` pass with all optim…

    4487228
  13. 20 remaining items

  14. Agent-Hellboy
    added a commit that references this issue on Aug 19, 2025

    pythongh-136438: Make sure `test_dis` pass with all optimization leve…

    9bc2fb3
  15. encukou
    added a commit that references this issue on Aug 28, 2025

    gh-136438: Make sure `test_compile` pass with all optimization levels (…

    f914e0a
  16. kumaraditya303
    added 2 commits that reference this issue on Sep 9, 2025

    [3.14] pythongh-136438: Make sure `test_builtins` pass with all optim…

    b0c33fe

    [3.14] pythongh-136438: Make sure `test_remote_pdb` pass with all opt…

    a5658ab
  17. lkollar
    added a commit that references this issue on Sep 9, 2025

    pythongh-136438: Make sure `test_compile` pass with all optimization …

    4ea7490
  18. hauntsaninja
    added a commit that references this issue on Oct 12, 2025

    gh-136438: Make sure test.test_pydoc.test_pydoc pass with all optimiz…

    bb85af3
  19. donbarbos commented on Dec 25, 2025

    @donbarbos
    donbarbos
    on Dec 25, 2025
    Contributor
    More actions

    It has been almost six months since this issue was opened, and during that time most of the test failures were fixed. However, new problematic spots in the test suite have appeared since then.

    I have identified issues at least in the following tests:

       test_inspect.test_inspect test_inspecttest_dataclasses test_idletest_importlib
       test_interpreters test_pyrepl test_sys_settrace test_unparse
    

    This seems to suggest that keeping this issue open may not be very effective unless there is an intention to actively monitor and enforce it in CI, as such cases tend to reappear and proliferate over time.

  20. encukou
    added a commit that references this issue on Jan 9, 2026

    gh-136438: Make sure `test_interpreters` pass with all optimization l…

    499d3a8
  21. StanFromIreland commented on Jan 9, 2026

    @StanFromIreland
    StanFromIreland
    on Jan 9, 2026
    Member
    More actions

    I'm afraid I agree with Dan, we are fighting a loosing battle, currently on Linux I see:

    • test.test_inspect.test_inspect
    • test_dataclasses
    • test_dis -- We already fixed this one in gh-136438: Make sure test_dis pass with all optimization levels #136593, these were introduced shortly after :-(
    • test_pyrepl
    • test_importlib
    • test_sys_settrace
    • test_unparse

    This feels like a futile effort if the tests we fix are failing the following month.

  22. StanFromIreland
    added
    pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided
    and removed
    easy
    on Jan 9, 2026
  23. reidenong
    added a commit that references this issue on Jan 12, 2026

    pythongh-136438: Make sure `test_interpreters` pass with all optimiza…

    a0f4dfa
  24. thunder-coding
    added a commit that references this issue on Feb 15, 2026

    pythongh-136438: Make sure `test_interpreters` pass with all optimiza…

    f4ffad3
  25. StanFromIreland commented on May 30, 2026

    @StanFromIreland
    StanFromIreland
    on May 30, 2026
    Member
    More actions

    Little ping @sobolevn, can this be closed?

  26. sobolevn
    closed this as completedon May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedtestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.