File tree 2 files changed +3
-4
lines changed 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -376,6 +376,9 @@ def _in_venv(path: Path) -> bool:
376
376
377
377
378
378
def pytest_ignore_collect (collection_path : Path , config : Config ) -> Optional [bool ]:
379
+ if collection_path .name == "__pycache__" :
380
+ return True
381
+
379
382
ignore_paths = config ._getconftest_pathlist (
380
383
"collect_ignore" , path = collection_path .parent
381
384
)
@@ -505,8 +508,6 @@ def collect(self) -> Iterable[Union[nodes.Item, nodes.Collector]]:
505
508
ihook = self .ihook
506
509
for direntry in scandir (self .path ):
507
510
if direntry .is_dir ():
508
- if direntry .name == "__pycache__" :
509
- continue
510
511
path = Path (direntry .path )
511
512
if not self .session .isinitpath (path , with_parents = True ):
512
513
if ihook .pytest_ignore_collect (collection_path = path , config = config ):
Original file line number Diff line number Diff line change @@ -707,8 +707,6 @@ def sort_key(entry: "os.DirEntry[str]") -> object:
707
707
ihook = self .ihook
708
708
for direntry in scandir (self .path , sort_key ):
709
709
if direntry .is_dir ():
710
- if direntry .name == "__pycache__" :
711
- continue
712
710
path = Path (direntry .path )
713
711
if not self .session .isinitpath (path , with_parents = True ):
714
712
if ihook .pytest_ignore_collect (collection_path = path , config = config ):
You can’t perform that action at this time.
0 commit comments