Fix Python 3.12+ test failures in drop-3.11 PR#15125
Closed
Conversation
Co-authored-by: Carreau <335567+Carreau@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Debug failures of pull request 15121
Fix test failures in drop Python 3.11 PR
Feb 10, 2026
Co-authored-by: Carreau <335567+Carreau@users.noreply.github.com>
Co-authored-by: Carreau <335567+Carreau@users.noreply.github.com>
Copilot
AI
changed the title
Fix test failures in drop Python 3.11 PR
Fix test failures for Python 3.12+ compatibility in drop-3.11 PR
Feb 10, 2026
Register os._Environ as a deferred printer (by module+name) in addition to
the direct type registration. This ensures the custom printer works even in
scenarios where the os module might be reloaded or imported in different
orders (e.g., in test environments with oldest-direct dependencies), as
deferred printers use module and class name lookup rather than type identity.
This fixes the test_pretty_environ failure in the oldest-deps CI job where
os.environ was being printed as environ({...}) instead of environ{...}
Co-authored-by: Carreau <335567+Carreau@users.noreply.github.com>
…ank line Co-authored-by: Carreau <335567+Carreau@users.noreply.github.com>
Copilot
AI
changed the title
Fix test failures for Python 3.12+ compatibility in drop-3.11 PR
Fix Python 3.12+ test failures in drop-3.11 PR
Feb 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes four test failures in PR #15121 which drops Python 3.11 support and updates to Python 3.12+.
Changes
Unicode range assertion (
test_completer.py)148853→153626for Python 3.15's expanded Unicode character setXPASS strict handling (
test_oinspect.py)strict=Truefromtest_pinfo_docstring_dynamicxfail marker (test now passes on 3.15-dev)Function signature version check (
test_pretty.py)sys.version_info > (3, 15)→>= (3, 15)for positional-only parameter syntax detectionos.environ pretty-printing (
IPython/lib/pretty.py)os._Environas deferred printer to fix printing asenviron({...})instead ofenviron{...}in oldest-deps CI__repr__toos._Environ; deferred registration uses module+name lookup instead of type identity, making it robust to module reloading scenarios in test environments💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.