Fix and re-enable xfail/skipped tests, clean up stale test TODOs - #15354
Draft
Carreau wants to merge 4 commits into
Draft
Fix and re-enable xfail/skipped tests, clean up stale test TODOs#15354Carreau wants to merge 4 commits into
Carreau wants to merge 4 commits into
Conversation
The TODO comment about removing code when only Python >= 3.6 is supported is obsolete as IPython requires much newer Python versions. The code below the comment (using pathlib.PurePath) is valid and necessary for the test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
curio's module_not_available("curio") check no longer blows up during
collection (it was previously wrapped in an unconditional skip plus a
stale xfail to work around that). Verified with curio 1.6 (latest on
PyPI) that: skip_without("curio") collects fine whether or not curio
is installed, the test passes when curio is installed, and it is
properly skipped (not errored) when curio is absent.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
`test_decorator_skip`, `test_decorator_skip_disabled` and
`test_decorator_skip_with_breakpoint` were all skipped with "recently
fail for unknown reason on CI". The reason turns out to be a Python
version behaviour change rather than flakiness: since Python 3.13,
`set_trace()`/`breakpoint()` stop on the line where they are called
instead of on the following line.
The shared fixture runs
def f():
ipdb.set_trace()
bar(3, 4)
so on 3.13+ the debugger stops on the `ipdb.set_trace()` line and one
extra `step` is needed before the `bar(3, 4)` call is reached. The two
`test_decorator_skip*` tests stepped straight into what they assumed was
the decorated call, landed on `bar(3, 4)` instead, never saw the
`--Call--` frame they expected, and timed out.
`test_decorator_skip_with_breakpoint` already had a version guard, but a
later "try to fix on CI" tweak added a 3.14 branch expecting the current
line to be printed *without* the `-->` marker. That does not match
released 3.14/3.15, where the output is identical to 3.13
(`---> 46 ipdb.set_trace()`); the extra branch is dropped and the
3.13 branch now covers everything from 3.13 on.
Introduce `SET_TRACE_STOPS_ON_CALLING_LINE` to express the behaviour
change once, use it in the three tests, and drop the skip markers.
Verified on CPython 3.11, 3.12, 3.13, 3.14, 3.14t (free-threaded) and
3.15.0b4: all three tests pass, including eight consecutive runs on
3.11/3.13/3.14 and runs under CPU oversubscription.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
`_determine_completion_context` treated any trailing dot as an attribute
access, so nonsense expressions like `3a.` or `$).` were routed to
attribute completion. It also mis-detected nested f-strings (`f'{f'a.`)
because the naive quote tracking sees the inner opening quote as closing
the outer one, leaving `is_string` False while still inside a
replacement field.
Scan backwards from the trailing dot to extract the primary expression it
would apply to (handling bracketed groups and string literals), and only
report an attribute context if that expression parses. Template string
replacement fields are now recursed into whenever we are inside one,
regardless of the `is_string` flag.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
This PR goes through xfail/skipped tests and stale TODOs in the test suite and fixes the ones that were fixable, one commit per fix:
Re-enable the
__debuggerskip__decorator-skipping tests (tests/test_debugger.py): the threetest_decorator_skip*tests were skipped with "recently fail for unknown reason on CI". The pexpect expectations had drifted from actual ipdb output; the expectations are updated to match real output and the tests now pass reliably (verified over repeated runs).Fall back to global completion for malformed attribute contexts (
IPython/core/completer.py,tests/test_completer.py): removes thexfail(reason="Completion context not yet supported")ontest_unsupported_completion_context._determine_completion_contexttreated any trailing dot as attribute access, so nonsense like3a.or$).was routed to attribute completion, and nested f-strings (f'{f'a.) were mis-detected by the naive quote tracking. The primary expression preceding the trailing dot is now extracted (handling bracketed groups and string literals) and only reported as an attribute context if it actually parses; template-string replacement fields are recursed into.Re-enable
test_autoawait_curio(tests/test_async_helpers.py): the test was unconditionally skipped becauseskip_without("curio")itself failed on Python 3.12 at the time. That is no longer the case; the unconditional skip and stale xfail are replaced with a normal@skip_without("curio"), matching the trio tests next to it. Verified both with curio installed (runs and passes) and without (skips cleanly).Remove a stale "Python >= 3.6" TODO comment in
tests/test_display.py.All affected test files pass locally:
tests/test_completer.py tests/test_debugger.py tests/test_display.py tests/test_async_helpers.py→ 386 passed, 17 skipped (remaining skips are platform-conditional).🤖 Generated with Claude Code
https://claude.ai/code/session_01GiZqwbkE2gL6C6JHV8chCg
Generated by Claude Code