Latest pytest, pytest-asyncio and flaky just can't live happily together. When a flaky test fails, an error RuntimeError: Event loop is closed is reported instead of failure. Edit: In fact, first test failure breaks the harness and "flak...
Avoid errors in cleanup of async generators when event loop is already closed#1040 v0.25.2: pytest-asyncio 0.25.2 Compare Source Callloop.shutdown_asyncgens()before closing the event loop to ensure async generators are closed in the same manner asasyncio.rundoes#1034 v0.25.1: pytest-...
I can't upgrade (and it seems like I'm not the only one) higher than v21 because of a known issue with v23 that is still being fixed: As of v0.23, pytest-asyncio attaches an asyncio event loop to each item of the test suite (i.e. session, packages, modules, classes, functions...
get_event_loop() is not self.loop: raise RuntimeError( "This connection is being used with a different event loop!") return "Success" @pytest_asyncio.fixture(scope="module", loop_scope="module") async def async_connection(): """Set up a async connection object with module scope."""...
"" policy = asyncio.get_event_loop_policy() loop = policy.new_event_loop() yield loop loop.close() And every single AsyncGenerator fixtures we have actually require event_loop to make sure the teardown is done before the loop is closed. Sharing this use-case hoping to help further ...
Bumps pytest-asyncio from 0.23.8 to 0.25.2. Release notes Sourced from pytest-asyncio's releases. pytest-asyncio 0.25.2 Call loop.shutdown_asyncgens() before closing the event loop to ensure asy...
When trying to do UI automtion with pytest-asyncio and pytest-playwright, I got exception like: RuntimeError: Cannot run the event loop while another loop is running Code structure: ui2/conftest.py ui2/test_bing.py ui2/conftest.py import...
test_custom_scalar_in_output_with_transport is asynchronous and explicitly requests the "event_loop" fixture. Asynchronous fixtures and test functions should use "asyncio.get_running_loop()" instead.@pytest.mark.asynciotests/custom_scalars/test_money.py:511tests/custom_scalars/test_money.py:511: ...
Cancel Create saved search Sign in Sign up {{ message }} pytest-dev / pytest-asyncio Public Notifications You must be signed in to change notification settings Fork 139 Star 1.3k Code Issues 48 Pull requests 9 Discussions Actions Projects Security Insights ...
When running the test suite on Python 3.11, tests with a @pytest.mark.asyncio decorator, trigger a DeprecationWarning: .../python3.11/site-packages/pytest_asyncio/plugin.py:884: DeprecationWarning: There is no current event loop _loop = ...