@@ -70,10 +70,6 @@ class PytestAsyncioError(Exception):
7070 """Base class for exceptions raised by pytest-asyncio"""
7171
7272
73- class MultipleEventLoopsRequestedError (PytestAsyncioError ):
74- """Raised when a test requests multiple asyncio event loops."""
75-
76-
7773class Mode (str , enum .Enum ):
7874 AUTO = "auto"
7975 STRICT = "strict"
@@ -808,14 +804,6 @@ def pytest_generate_tests(metafunc: Metafunc) -> None:
808804 return
809805 fixturemanager = metafunc .config .pluginmanager .get_plugin ("funcmanage" )
810806 assert fixturemanager is not None
811- if "event_loop" in metafunc .fixturenames :
812- raise MultipleEventLoopsRequestedError (
813- _MULTIPLE_LOOPS_REQUESTED_ERROR .format (
814- test_name = metafunc .definition .nodeid ,
815- scope = scope ,
816- scoped_loop_node = event_loop_node .nodeid ,
817- ),
818- )
819807 # Add the scoped event loop fixture to Metafunc's list of fixture names and
820808 # fixturedefs and leave the actual parametrization to pytest
821809 # The fixture needs to be appended to avoid messing up the fixture evaluation
@@ -943,18 +931,6 @@ def inner(*args, **kwargs):
943931 return inner
944932
945933
946- _MULTIPLE_LOOPS_REQUESTED_ERROR = dedent (
947- """\
948- Multiple asyncio event loops with different scopes have been requested
949- by {test_name}. The test explicitly requests the event_loop fixture, while
950- another event loop with {scope} scope is provided by {scoped_loop_node}.
951- Remove "event_loop" from the requested fixture in your test to run the test
952- in a {scope}-scoped event loop or remove the scope argument from the "asyncio"
953- mark to run the test in a function-scoped event loop.
954- """
955- )
956-
957-
958934def pytest_runtest_setup (item : pytest .Item ) -> None :
959935 marker = item .get_closest_marker ("asyncio" )
960936 if marker is None :
0 commit comments