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

@@ -274,10 +274,12 @@ def pytest_ignore_collect(path: py.path.local, config: "Config") -> Optional[boo
"""
def pytest_collect_file(path: py.path.local, parent) -> "Optional[Collector]":
"""Return collection Node or None for the given path.
def pytest_collect_file(
path: py.path.local, parent: "Collector"
) -> "Optional[Collector]":
"""Create a Collector for the given path, or None if not relevant.
Any new node needs to have the specified ``parent`` as a parent.
The new node needs to have the specified ``parent`` as a parent.
:param py.path.local path: The path to collect.
"""