Skip to content

Commit e64b8f3

Browse files
committed
TypeError
1 parent eeb6593 commit e64b8f3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/_pytest/nodes.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,11 @@ def from_parent(cls, parent, *, fspath):
452452
return cls._create(parent=parent, fspath=fspath)
453453

454454
def gethookproxy(self, fspath):
455+
from _pytest.main import Session # noqa: F811
456+
from _pytest.python import Package
457+
458+
if not isinstance(self, (Session, Package)):
459+
raise TypeError()
455460
# check if we have the common case of running
456461
# hooks with all conftest.py files
457462
pm = self.config.pluginmanager

0 commit comments

Comments
 (0)