File tree 2 files changed +4
-2
lines changed 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -482,6 +482,8 @@ def collect(self):
482
482
self .trace .root .indent -= 1
483
483
484
484
def _collect (self , arg ):
485
+ from _pytest .python import Package
486
+
485
487
names = self ._parsearg (arg )
486
488
argpath = names .pop (0 )
487
489
paths = []
@@ -503,7 +505,7 @@ def _collect(self, arg):
503
505
root = self ._node_cache [pkginit ]
504
506
else :
505
507
col = root ._collectfile (pkginit )
506
- if col :
508
+ if col and isinstance ( col , Package ) :
507
509
root = col [0 ]
508
510
self ._node_cache [root .fspath ] = root
509
511
Original file line number Diff line number Diff line change @@ -647,7 +647,7 @@ def test_pkgfile(self, testdir):
647
647
col = testdir .getnode (config , x )
648
648
assert isinstance (col , pytest .Module )
649
649
assert col .name == "x.py"
650
- assert col .parent .parent . parent is None
650
+ assert col .parent .parent is None
651
651
for col in col .listchain ():
652
652
assert col .config is config
653
653
You can’t perform that action at this time.
0 commit comments