We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c42ffe commit 28f287bCopy full SHA for 28f287b
1 file changed
pytest_asyncio/plugin.py
@@ -874,23 +874,6 @@ def _scoped_runner(
874
)
875
876
877
-@contextlib.contextmanager
878
-def _provide_event_loop() -> Iterator[asyncio.AbstractEventLoop]:
879
- policy = _get_event_loop_policy()
880
- loop = policy.new_event_loop()
881
- try:
882
- yield loop
883
- finally:
884
- # cleanup the event loop if it hasn't been cleaned up already
885
- if not loop.is_closed():
886
887
- loop.run_until_complete(loop.shutdown_asyncgens())
888
- except Exception as e:
889
- warnings.warn(f"Error cleaning up asyncio loop: {e}", RuntimeWarning)
890
891
- loop.close()
892
-
893
894
@pytest.fixture(scope="session", autouse=True)
895
def event_loop_policy() -> AbstractEventLoopPolicy:
896
"""Return an instance of the policy used to create asyncio event loops."""
0 commit comments