We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
get_scope_node
1 parent fe64939 commit 0910c35Copy full SHA for 0910c35
src/_pytest/fixtures.py
@@ -132,6 +132,12 @@ def get_scope_package(
132
133
134
def get_scope_node(node: nodes.Node, scope: Scope) -> nodes.Node | None:
135
+ """Get the closest parent node (including self) which matches the given
136
+ scope.
137
+
138
+ If there is no parent node for the scope (e.g. asking for class scope on a
139
+ Module, or on a Function when not defined in a class), returns None.
140
+ """
141
import _pytest.python
142
143
if scope is Scope.Function:
0 commit comments