-
-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Labels
extensions/fixturesRelated to fixturesRelated to fixtureswishNot on the current roadmap; maybe in the futureNot on the current roadmap; maybe in the future
Description
If the request is for a test function the request.node is just the current function.
Otherwise, from pytest:
@property
def node(self):
scope = self._scope
if scope is Scope.Function:
# This might also be a non-function Item despite its attribute name.
node: nodes.Node | None = self._pyfuncitem
elif scope is Scope.Package:
node = get_scope_package(self._pyfuncitem, self._fixturedef)
else:
node = get_scope_node(self._pyfuncitem, scope)
if node is None and scope is Scope.Class:
# Fallback to function item itself.
node = self._pyfuncitem
assert node, (
f'Could not obtain a node for scope "{scope}" for function {self._pyfuncitem!r}'
)
return nodeReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
extensions/fixturesRelated to fixturesRelated to fixtureswishNot on the current roadmap; maybe in the futureNot on the current roadmap; maybe in the future