Function
get_scope_package
(node, fixturedef: "FixtureDef[object]")
Source from the content-addressed store, hash-verified
| 115 | |
| 116 | |
| 117 | def 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 | |
| 132 | def get_scope_node( |
Tested by
no test coverage detected