Repository navigation
Fix CI for pytest 9.2 and rq 3.0 - #869
Merged
Merged
Conversation
pytest 9.2.0 now applies filterwarnings to warnings emitted during pytest_configure, so pytest-asyncio's PytestDeprecationWarning about the unset asyncio_default_fixture_loop_scope option is turned into an error by `filterwarnings = error`. pytest then aborts with INTERNALERROR before collecting any tests, failing every tox env. Set the option explicitly to "function", the scope pytest-asyncio says will become its default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NgEia2KuXhw1rAKi99X1ow
jrothrock
approved these changes
Oct 29, 2026
jrothrock
left a comment
Contributor
There was a problem hiding this comment.
Confirmed the repo has no async fixtures so function changes no test behavior, and every tox env (py310+) pulls a pytest-asyncio that knows the key — clean fix. 👍
rq 3.0 moved the PERSIST call on the job key out of Job.perform and into the worker's pipeline, so it no longer happens inside Scout's job span. The tests hard-coded that rq internal and expected a Redis/PERSIST span before the Job span, failing on every tox env once rq 3.0.0 was installed. Only expect the Redis/PERSIST span on rq < 3.0. The instrumentation itself is unaffected: the Job span, tags, and error tagging are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NgEia2KuXhw1rAKi99X1ow
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.
Problem
CI has been failing on master since #866 (and on #868) across every Python test job. Two unpinned test dependencies released new versions between the last green run and now:
1. pytest 9.1.1 → 9.2.0
pytest aborts with
INTERNALERROR(exit code 3) before collecting any tests:With pytest 9.2.0, pytest-asyncio's configure-time deprecation warning is turned into an error by our
filterwarnings = errorinpytest.ini.2. rq 2.12.0 → 3.0.0
Once tests could run,
test_rq.py::test_helloandtest_failfailed in every env (assert 1 == 2on span count). rq < 3.0 calledPERSISTon the job key insideJob.perform, so it was captured as aRedis/PERSISTspan within Scout's job span. rq 3.0 moved that call into the worker's pipeline. The instrumentation itself is unaffected — the Job span, tags, and error tagging are unchanged; the tests had hard-coded an rq internal.Fix
asyncio_default_fixture_loop_scope = functioninpytest.ini(the scope pytest-asyncio says will become its default).Redis/PERSISTspan in the RQ tests on rq < 3.0.Testing
pytest.iniand pytest-asyncio 1.4.1, a trivial test crashes on pytest 9.2.0 without the setting and passes with it; still passes on 9.1.1.tests/integration/test_rq.pypasses (3/3) against a local Redis on both rq 3.0.0 and rq 2.12.0.🤖 Generated with Claude Code
https://claude.ai/code/session_01NgEia2KuXhw1rAKi99X1ow