File tree Expand file tree Collapse file tree 1 file changed +0
-23
lines changed Expand file tree Collapse file tree 1 file changed +0
-23
lines changed Original file line number Diff line number Diff line change 3535import pytest
3636from _pytest .scope import Scope
3737from pytest import (
38- Class ,
3938 Collector ,
4039 Config ,
4140 FixtureDef ,
4443 Item ,
4544 Mark ,
4645 Metafunc ,
47- Module ,
48- Package ,
4946 Parser ,
5047 PytestCollectionWarning ,
5148 PytestDeprecationWarning ,
5249 PytestPluginManager ,
53- Session ,
5450)
5551
5652if sys .version_info >= (3 , 10 ):
@@ -832,25 +828,6 @@ def _get_default_test_loop_scope(config: Config) -> _ScopeName:
832828 return config .getini ("asyncio_default_test_loop_scope" )
833829
834830
835- def _retrieve_scope_root (item : Collector | Item , scope : str ) -> Collector :
836- node_type_by_scope = {
837- "class" : Class ,
838- "module" : Module ,
839- "package" : Package ,
840- "session" : Session ,
841- }
842- scope_root_type = node_type_by_scope [scope ]
843- for node in reversed (item .listchain ()):
844- if isinstance (node , scope_root_type ):
845- assert isinstance (node , pytest .Collector )
846- return node
847- error_message = (
848- f"{ item .name } is marked to be run in an event loop with scope { scope } , "
849- f"but is not part of any { scope } ."
850- )
851- raise pytest .UsageError (error_message )
852-
853-
854831def _create_scoped_event_loop_fixture (scope : _ScopeName ) -> Callable :
855832 @pytest .fixture (
856833 scope = scope ,
You can’t perform that action at this time.
0 commit comments