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 35
35
import pytest
36
36
from _pytest .scope import Scope
37
37
from pytest import (
38
- Class ,
39
38
Collector ,
40
39
Config ,
41
40
FixtureDef ,
44
43
Item ,
45
44
Mark ,
46
45
Metafunc ,
47
- Module ,
48
- Package ,
49
46
Parser ,
50
47
PytestCollectionWarning ,
51
48
PytestDeprecationWarning ,
52
49
PytestPluginManager ,
53
- Session ,
54
50
)
55
51
56
52
if sys .version_info >= (3 , 10 ):
@@ -832,25 +828,6 @@ def _get_default_test_loop_scope(config: Config) -> _ScopeName:
832
828
return config .getini ("asyncio_default_test_loop_scope" )
833
829
834
830
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
-
854
831
def _create_scoped_event_loop_fixture (scope : _ScopeName ) -> Callable :
855
832
@pytest .fixture (
856
833
scope = scope ,
You can’t perform that action at this time.
0 commit comments