Skip to content

Commit 21cf8d8

Browse files
committed
refactor: Event loop fixture IDs are no longer stored in the node stash.
1 parent 66b5bd0 commit 21cf8d8

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

pytest_asyncio/plugin.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
Generator,
2020
Iterable,
2121
Iterator,
22-
Mapping,
2322
Sequence,
2423
)
2524
from typing import (
@@ -52,7 +51,6 @@
5251
PytestDeprecationWarning,
5352
PytestPluginManager,
5453
Session,
55-
StashKey,
5654
)
5755

5856
if sys.version_info >= (3, 10):
@@ -641,31 +639,6 @@ def pytest_pycollect_makeitem_convert_async_functions_to_subclass(
641639
hook_result.force_result(updated_node_collection)
642640

643641

644-
_event_loop_fixture_id = StashKey[str]()
645-
_fixture_scope_by_collector_type: Mapping[type[pytest.Collector], _ScopeName] = {
646-
Class: "class",
647-
# Package is a subclass of module and the dict is used in isinstance checks
648-
# Therefore, the order matters and Package needs to appear before Module
649-
Package: "package",
650-
Module: "module",
651-
Session: "session",
652-
}
653-
654-
655-
@pytest.hookimpl
656-
def pytest_collectstart(collector: pytest.Collector) -> None:
657-
try:
658-
collector_scope = next(
659-
scope
660-
for cls, scope in _fixture_scope_by_collector_type.items()
661-
if isinstance(collector, cls)
662-
)
663-
except StopIteration:
664-
return
665-
event_loop_fixture_id = f"_{collector_scope}_event_loop"
666-
collector.stash[_event_loop_fixture_id] = event_loop_fixture_id
667-
668-
669642
@contextlib.contextmanager
670643
def _temporary_event_loop_policy(policy: AbstractEventLoopPolicy) -> Iterator[None]:
671644
old_loop_policy = asyncio.get_event_loop_policy()

0 commit comments

Comments
 (0)