test_sync_async_add: After closing the default event loop, set a new one #22
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.
TestAsyncCase.test_sync_async_add
leaves the default loop closed. IfTestAsyncCaseWithCustomLoop.test_await_async_add
runs right after it, it will fail.As far as I can see from the other test methods, the default loop should be reset if it's closed.
Usually, this issue is masked by tests that run in between these two and re-set the default event loop as a side effect. It can be reproduced with
pytest -k 'test_await_async_add or test_sync_async_add'
, or on Python 3.11 with #21 merged (cc @hroncok).