MCPcopy Create free account
hub / github.com/pytest-dev/pytest / get_scope_package

Function get_scope_package

src/_pytest/fixtures.py:117–129  ·  view source on GitHub ↗
(node, fixturedef: "FixtureDef[object]")

Source from the content-addressed store, hash-verified

115
116
117def get_scope_package(node, fixturedef: "FixtureDef[object]"):
118 import pytest
119
120 cls = pytest.Package
121 current = node
122 fixture_package_name = "{}/{}".format(fixturedef.baseid, "__init__.py")
123 while current and (
124 type(current) is not cls or fixture_package_name != current.nodeid
125 ):
126 current = current.parent
127 if current is None:
128 return node.session
129 return current
130
131
132def get_scope_node(

Callers 1

_getscopeitemMethod · 0.85

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected