You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tests: drop unused 'event_loop' fixture arg from test_resolver.py (3 collection errors) #214
Three tests in tests/test_resolver.py declare event_loop as a fixture argument but never use it:
asyncdeftest_get_real_ext_ip(event_loop, mocker, resolver): # line 63asyncdeftest_resolve(event_loop, mocker, resolver): # line 101asyncdeftest_resolve_cache(event_loop, mocker, resolver): # line 224
pytest-asyncio deprecated the auto-provided event_loop fixture in 0.21 and removed it in 0.23. This project is on 0.26.0 (per pyproject.toml), so all three tests error at collection with:
fixture 'event_loop' not found
Root cause
These declarations date back to 2017 (commit d5602973, Constverum). At that time, declaring event_loop as an arg ensured pytest-asyncio set up a loop before the test body ran. Modern pytest-asyncio handles loop setup automatically via @pytest.mark.asyncio (or auto mode), so the arg is redundant.
The arg is never used inside any of the three function bodies — grep -c "event_loop" tests/test_resolver.py would show 0 references inside the bodies.
Fix (15-minute change)
Remove the unused event_loop arg from the three function signatures:
That's the entire change. No other code modifications.
Acceptance criteria
All 3 tests collect cleanly (no fixture 'event_loop' not found).
All 3 tests pass against the existing mocks.
No new fixtures introduced; no conftest.py change needed.
pytest tests/ reports zero collection errors.
Why this is safe
The arg has been unused for years; removing it can't change test semantics.
pytest-asyncio's automatic loop management (already enabled per pyproject.toml) handles what event_loop arg used to handle.
Existing @pytest.mark.asyncio decorator stays.
Why this matters
These 3 errors mask real test failures — every full-suite run reports "3 errors" alongside actual passes/failures, so a contributor scanning CI output for new breakage has to mentally subtract these. PR #212 already trained me to filter them out, which is exactly the sort of "noise drowns signal" anti-pattern that makes test suites lose their value over time.
Out of scope
Pinning pytest-asyncio<0.23 (regression to old behavior, not the modern path)
Defining a custom event_loop fixture in conftest.py (overkill; the arg isn't even used)
Activity
fix(ipv6): address PR #212 review - canonicalize resolve() outputs, f…
fix(tests): test_resolve_cache mock for parallel A+AAAA queries
fix(tests): test_resolve_cache call_count for parallel A+AAAA
fix(tests): drop unused event_loop fixture arg (closes #214)
fix(ipv6): address coderabbit + codex review feedback (PR #212 round 8)
chore(release): 2.0.0b3