[TEST]: silence pytest-asyncio deprecation warning in xdist pytester tests#103
Open
spencrr wants to merge 2 commits into
Open
[TEST]: silence pytest-asyncio deprecation warning in xdist pytester tests#103spencrr wants to merge 2 commits into
spencrr wants to merge 2 commits into
Conversation
3 tasks
spencrr
added a commit
that referenced
this pull request
Jul 7, 2026
## Description Drop references to `pyright` following #86. Some other refs dropped in #103 too. This PR gets the rest (which are only in `rampart/surfaces/onedrive.py`. ## Breaking changes None ## Checklist - [X] `pre-commit run --all-files` passes - [ ] Tests added or updated for changes <!-- Please describe what tests were added or updated --> - [ ] Documentation updated
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.
Description
The
tests/unit/pytest_plugin/test_xdist_aggregation.pysuite spawns child pytest sessions viapytester. Each child session is configuration-isolated from the repository'spyproject.toml, so pytest-asyncio read an emptyasyncio_default_fixture_loop_scopeviaconfig.getini(...)and emitted aPytestDeprecationWarningonce per subprocess run (14 warnings across the suite).This PR resolves the warnings by writing a minimal ini file into each child project root that mirrors the parent project's asyncio configuration (
asyncio_mode = auto,asyncio_default_fixture_loop_scope = session), so the option is supplied through the same channel pytest-asyncio actually reads.To keep it DRY, the child conftest and ini creation are consolidated into a single
configured_pytesterfixture that every test now depends on, removing the scattered per-testpytester.makeconftest(...)boilerplate (and the now-unnecessary# pyright: ignorecomments onmakepyfile(...)).Result:
13 passed, warning-free.Alternatives considered
conftest.pypytest_configurehook — e.g.config.option.asyncio_default_fixture_loop_scope = "function"orconfig.addinivalue_line("asyncio_default_fixture_loop_scope", "function"). Rejected: pytest-asyncio reads the value viaconfig.getini("asyncio_default_fixture_loop_scope"), so theconfig.optionnamespace is never consulted, andaddinivalue_lineonly appends to line-list ini options (e.g.markers,filterwarnings), not a scalar string option. Neither reachesgetini(...), so the warning persisted.-o asyncio_default_fixture_loop_scope=sessionto everyrunpytest(...)— Works, but repeats the override across ~14 call sites; the ini file centralizes it in one place.-p no:asyncio— Silences the warning (the child sessions are all synchronous), but diverges from the real project configuration and sidesteps configuring the very option these tests should exercise.filterwarnings— A band-aid that hides the symptom rather than setting the option, and would also mask the warning if it ever surfaced legitimately elsewhere.Breaking changes
None.
Checklist
pre-commit run --all-filespasses