Conversation
Document the strict-mode limitation and provide an executable example. Related to pytest-dev#1463. AI-assisted with Codex (GPT-6 Astra).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1558 +/- ##
=======================================
Coverage 94.50% 94.50%
=======================================
Files 2 2
Lines 510 510
Branches 62 62
=======================================
Hits 482 482
Misses 22 22
Partials 6 6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks for your interest in improving the documentation! I'm going to close this because the working usage is already covered by the existing documentation (which this PR somewhat duplicates), and the additional restriction pertains to an unresolved bug. I'd rather keep workaround attached to that issue rather than expand the guide around it. I'll also add that although #1463 is definitely a bug we should solve, the workaround is specific to code example posted by the reporter, and not a pattern that I'd like to bless in the documentation itself. |
In strict mode, adding an asyncio marker only through
pytest.paramdoes not trigger loop-factory parametrization. The parametrization guide currently does not mention this limitation.Document where to place the marker, with an executable example showing two parameter values running against two loop factories. Also explain why mixed asyncio/Trio parameter sets need separately marked test functions. The example is collected by the existing documentation test suite.
Related to #1463. This documents the existing limitation and a working usage pattern; it does not resolve the underlying runtime issue.
Validation on macOS, Python 3.13.11, pytest 9.1.1:
--asyncio-mode=strict.-n -W --keep-going; pre-commit checks pass for all changed files.294 passed, 3 skipped, 1 failed; with this patch298 passed, 3 skipped, 1 failed. The same existing failure intest_asyncio_run_after_async_fixture_does_not_leak_loopraisesPytestAssertRewriteWarningaboutpytest_asyncioalready being imported.AI assistance: Codex (GPT-6 Astra) assisted with investigation, documentation, and executable examples. The local behavior checks above were actually run.