Skip to content

Fix NotImplementedError crash when using xdist schedulers without mark_test_pending#309

Merged
icemac merged 6 commits intopytest-dev:masterfrom
msabramo:GH-247
Oct 8, 2025
Merged

Fix NotImplementedError crash when using xdist schedulers without mark_test_pending#309
icemac merged 6 commits intopytest-dev:masterfrom
msabramo:GH-247

Conversation

@msabramo
Copy link
Copy Markdown
Contributor

@msabramo msabramo commented Sep 25, 2025

Handle gracefully when pytest-xdist schedulers (like LoadScopeScheduling) don't implement mark_test_pending by catching NotImplementedError and failing the test with a clear message instead of crashing the test run.

When a test crashes and cannot be rescheduled:

  • Set report outcome to "failed" with informative error message
  • Explain which scheduler lacks rescheduling support
  • Show remaining rerun count that couldn't be used
  • Continue test execution instead of internal crash

Fixes #247

…k_test_pending

Handle gracefully when pytest-xdist schedulers (like LoadScopeScheduling)
don't implement mark_test_pending by catching NotImplementedError and
failing the test with a clear message instead of crashing the test run.

When a test crashes and cannot be rescheduled:
- Set report outcome to "failed" with informative error message
- Explain which scheduler lacks rescheduling support
- Show remaining rerun count that couldn't be used
- Continue test execution instead of internal crash

Fixes pytest-dev#247
@webknjaz
Copy link
Copy Markdown
Member

Can you separate infra changes (like the support matrix) from the actual functional changes in a separate PR? Also, the trove classifier update is missing from that.

@msabramo
Copy link
Copy Markdown
Contributor Author

Hi @webknjaz! Oh the infra changes were just me merging #308 into this branch so that I didn't have CI failures, but now that that PR was merged, I can remove that stuff.

Comment thread src/pytest_rerunfailures.py Outdated
@icemac icemac enabled auto-merge (squash) October 8, 2025 06:33
@icemac icemac merged commit 8d04ad9 into pytest-dev:master Oct 8, 2025
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pytest_handlecrashitem faults with NotImplementedError when using the loadgroup test distribution algorithm

3 participants