hookspec: type annotate parent argument to pytest_collect_file

This commit is contained in:
Ran Benita
2020-08-20 23:51:08 +03:00
parent 4b8e1a1771
commit 57aca11d4a
3 changed files with 10 additions and 5 deletions

View File

@@ -184,7 +184,9 @@ def pytest_pyfunc_call(pyfuncitem: "Function") -> Optional[object]:
return True
def pytest_collect_file(path: py.path.local, parent) -> Optional["Module"]:
def pytest_collect_file(
path: py.path.local, parent: nodes.Collector
) -> Optional["Module"]:
ext = path.ext
if ext == ".py":
if not parent.session.isinitpath(path):