Skip to content

Commit 0910c35

Browse files
committed
fixtures: add docstring for internal function get_scope_node
1 parent fe64939 commit 0910c35

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/_pytest/fixtures.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ def get_scope_package(
132132

133133

134134
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+
"""
135141
import _pytest.python
136142

137143
if scope is Scope.Function:

0 commit comments

Comments
 (0)