|
42 | 42 | Function, |
43 | 43 | Item, |
44 | 44 | Mark, |
45 | | - Metafunc, |
46 | 45 | MonkeyPatch, |
47 | 46 | Parser, |
48 | 47 | PytestCollectionWarning, |
@@ -547,32 +546,6 @@ def _temporary_event_loop_policy(policy: AbstractEventLoopPolicy) -> Iterator[No |
547 | 546 | _set_event_loop(old_loop) |
548 | 547 |
|
549 | 548 |
|
550 | | -@pytest.hookimpl(tryfirst=True) |
551 | | -def pytest_generate_tests(metafunc: Metafunc) -> None: |
552 | | - marker = metafunc.definition.get_closest_marker("asyncio") |
553 | | - if not marker: |
554 | | - return |
555 | | - default_loop_scope = _get_default_test_loop_scope(metafunc.config) |
556 | | - loop_scope = _get_marked_loop_scope(marker, default_loop_scope) |
557 | | - runner_fixture_id = f"_{loop_scope}_scoped_runner" |
558 | | - # This specific fixture name may already be in metafunc.argnames, if this |
559 | | - # test indirectly depends on the fixture. For example, this is the case |
560 | | - # when the test depends on an async fixture, both of which share the same |
561 | | - # event loop fixture mark. |
562 | | - if runner_fixture_id in metafunc.fixturenames: |
563 | | - return |
564 | | - fixturemanager = metafunc.config.pluginmanager.get_plugin("funcmanage") |
565 | | - assert fixturemanager is not None |
566 | | - # Add the scoped event loop fixture to Metafunc's list of fixture names and |
567 | | - # fixturedefs and leave the actual parametrization to pytest |
568 | | - # The fixture needs to be appended to avoid messing up the fixture evaluation |
569 | | - # order |
570 | | - metafunc.fixturenames.append(runner_fixture_id) |
571 | | - metafunc._arg2fixturedefs[runner_fixture_id] = fixturemanager._arg2fixturedefs[ |
572 | | - runner_fixture_id |
573 | | - ] |
574 | | - |
575 | | - |
576 | 549 | def _get_event_loop_policy() -> AbstractEventLoopPolicy: |
577 | 550 | with warnings.catch_warnings(): |
578 | 551 | warnings.simplefilter("ignore", DeprecationWarning) |
|
0 commit comments