@@ -188,19 +188,15 @@ def pytest_pyfunc_call(pyfuncitem: "Function") -> Optional[object]:
188188 return True
189189
190190
191- def pytest_collect_file (
192- fspath : Path , path : LEGACY_PATH , parent : nodes .Collector
193- ) -> Optional ["Module" ]:
191+ def pytest_collect_file (fspath : Path , parent : nodes .Collector ) -> Optional ["Module" ]:
194192 if fspath .suffix == ".py" :
195193 if not parent .session .isinitpath (fspath ):
196194 if not path_matches_patterns (
197195 fspath , parent .config .getini ("python_files" ) + ["__init__.py" ]
198196 ):
199197 return None
200198 ihook = parent .session .gethookproxy (fspath )
201- module : Module = ihook .pytest_pycollect_makemodule (
202- fspath = fspath , path = path , parent = parent
203- )
199+ module : Module = ihook .pytest_pycollect_makemodule (fspath = fspath , parent = parent )
204200 return module
205201 return None
206202
@@ -675,9 +671,8 @@ def _recurse(self, direntry: "os.DirEntry[str]") -> bool:
675671 if direntry .name == "__pycache__" :
676672 return False
677673 fspath = Path (direntry .path )
678- path = legacy_path (fspath )
679674 ihook = self .session .gethookproxy (fspath .parent )
680- if ihook .pytest_ignore_collect (fspath = fspath , path = path , config = self .config ):
675+ if ihook .pytest_ignore_collect (fspath = fspath , config = self .config ):
681676 return False
682677 norecursepatterns = self .config .getini ("norecursedirs" )
683678 if any (fnmatch_ex (pat , fspath ) for pat in norecursepatterns ):
@@ -687,17 +682,14 @@ def _recurse(self, direntry: "os.DirEntry[str]") -> bool:
687682 def _collectfile (
688683 self , fspath : Path , handle_dupes : bool = True
689684 ) -> Sequence [nodes .Collector ]:
690- path = legacy_path (fspath )
691685 assert (
692686 fspath .is_file ()
693687 ), "{!r} is not a file (isdir={!r}, exists={!r}, islink={!r})" .format (
694688 fspath , fspath .is_dir (), fspath .exists (), fspath .is_symlink ()
695689 )
696690 ihook = self .session .gethookproxy (fspath )
697691 if not self .session .isinitpath (fspath ):
698- if ihook .pytest_ignore_collect (
699- fspath = fspath , path = path , config = self .config
700- ):
692+ if ihook .pytest_ignore_collect (fspath = fspath , config = self .config ):
701693 return ()
702694
703695 if handle_dupes :
@@ -709,7 +701,7 @@ def _collectfile(
709701 else :
710702 duplicate_paths .add (fspath )
711703
712- return ihook .pytest_collect_file (fspath = fspath , path = path , parent = self ) # type: ignore[no-any-return]
704+ return ihook .pytest_collect_file (fspath = fspath , parent = self ) # type: ignore[no-any-return]
713705
714706 def collect (self ) -> Iterable [Union [nodes .Item , nodes .Collector ]]:
715707 this_path = self .path .parent
0 commit comments