Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate a test ordering dependency #636

Merged

Conversation

kurtmckee
Copy link
Contributor

If test_async_to_sync runs immediately before test_async_to_sync_no_thread, the "no thread" test will fail to raise RuntimeError because the module-level _event_loop_thread variable will still be set (although it will be a mock, not a real thread).

This was discovered while trying to eliminate a different warning that only pops up if all of the asyncio tests are run; if only a handful of tests were selected, the warning disappears.

I strongly recommend adding pytest-randomly to the test suite's Python dependencies to help shake out test suite interdependencies such as what was found here.

If `test_async_to_sync` runs immediately before `test_async_to_sync_no_thread`,
the "no thread" test will fail to raise `RuntimeError`
because the module-level `_event_loop_thread` variable will still be set
(although it will be a mock, not a real thread).
@Bogdanp Bogdanp merged commit cfcf4fa into Bogdanp:master Jun 25, 2024
10 of 11 checks passed
@kurtmckee kurtmckee deleted the eliminate-async-test-order-dependency branch June 25, 2024 15:31
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.

2 participants