Skip to content

Commit

Permalink
Rename pathlib hook parameters (ipython#9363)
Browse files Browse the repository at this point in the history
* Rename pytest_ignore_collect fspath parameter to collection_path

* Rename pytest_collect_file fspath parameter to file_path

* Rename pytest_pycollect_makemodule fspath parameter to module_path

* Rename pytest_report_header startpath parameter to start_path

* Rename pytest_report_collectionfinish startpath parameter to start_path

* Update docs with the renamed parameters

* Use pytest-flakes fork temporarily to prove it works

* Use pytest-flakes 4.0.5
  • Loading branch information
nicoddemus authored and Kojoley committed Feb 8, 2022
1 parent dacc63f commit 754ec7a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions IPython/testing/plugin/pytest_ipdoctest.py
Expand Up @@ -120,18 +120,18 @@ def pytest_unconfigure() -> None:


def pytest_collect_file(
fspath: Path,
file_path: Path,
parent: Collector,
) -> Optional[Union["DoctestModule", "DoctestTextfile"]]:
config = parent.config
if fspath.suffix == ".py":
if file_path.suffix == ".py":
if config.option.doctestmodules and not any(
(_is_setup_py(fspath), _is_main_py(fspath))
(_is_setup_py(file_path), _is_main_py(file_path))
):
mod: DoctestModule = DoctestModule.from_parent(parent, path=fspath)
mod: DoctestModule = DoctestModule.from_parent(parent, path=file_path)
return mod
elif _is_doctest(config, fspath, parent):
txt: DoctestTextfile = DoctestTextfile.from_parent(parent, path=fspath)
elif _is_doctest(config, file_path, parent):
txt: DoctestTextfile = DoctestTextfile.from_parent(parent, path=file_path)
return txt
return None

Expand Down

0 comments on commit 754ec7a

Please sign in to comment.