Conversation
Custom item names can contain delimiters that parse() interprets as structured fields. Compare and hash by the public nodeid string so lastfailed and stepwise can recognize cached custom items. Fixes pytest-dev#15045. Co-authored-by: OpenAI Codex <noreply@openai.com>
|
@RonnyPfannschmidt could you help to review this ? |
|
@nicoddemus i think this just demonstrates the practical version of my initial dislike of having no distinction between a opaque/reparsed id and a real id - back at the sprint i couldn't quite put my finger on it beacuse it indeed only occurs when someone moves out of the normal bounds the fix here seems like a stopgap but the full resolution seems at best daunting so we might need to stick with it for a bit |
|
The job is The visible log excerpt does not contain the failing test or traceback; it only shows the final summary: The five
These are already marked non-strict: @pytest.mark.xfail(reason="#10042", strict=False)Therefore, the The most likely corrective change for this PR is to update the remaining debugger regression test expectations consistently with the new capture behavior. The affected tests currently use exact pexpect output matching, for example: child.expect(r"PDB set_trace \(IO-capturing turned off\)")
child.expect(r"PDB continue \(IO-capturing resumed\)")If the implementation now includes fixture-specific status text, update the expectations to match the new output, as already done in child.expect(
rf"PDB set_trace \(IO-capturing turned off for fixture {fixture}\)"
)
child.expect(
rf"PDB continue \(IO-capturing resumed for fixture {fixture}\)"
)Also retain the Python 3.15 REPL workaround in the autouse fixture: pytester._monkeypatch.setenv("PYTHON_BASIC_REPL", "1")A correct patch should therefore:
tox run -e py313-pexpect-coverage -- \
testing/test_debugging.py -k pdbThe exact failing assertion cannot be identified from the excerpt because the failure traceback is absent, but the workflow and test source confirm that the failure is in the Python 3.13 pexpect debugger coverage job, not in the reported XPASS results. |
Fixes #15045.
Custom item names containing
[or::can produce different structured fields when their nodeid strings are read back from a cache. This makes--lfomit a still-failing item when another cached failure matches, and makes--swlose the resume point.Compare and hash
NodeIdinstances by their public string form while retaining the structured fields for callers. This preserves item identity across serialization without changing the cache format. Regression tests cover string round trips, hashing, distinct literal IDs, and fresh-process--lf/--swruns with custom items.Validation:
[1, 0, 1]to[1, 1, 1].PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest -q -p _hypothesis_pytestplugin --tb=short.With autoload disabled and Hypothesis not explicitly loaded up front, the full suite hits a
HypothesisSideeffectWarningintest_version_verbose. The same failure reproduces on unmodified main, including a two-test sequence; the command above loads the plugin before running tests. No warning filters or test exclusions were added.AI assistance: OpenAI Codex helped investigate, implement, and test this change and is credited in the commit trailer.