Rename pathlib hook parameters (#9363)
* 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
This commit is contained in:
@@ -809,9 +809,9 @@ class TestConftestCustomization:
|
||||
import pytest
|
||||
class MyModule(pytest.Module):
|
||||
pass
|
||||
def pytest_pycollect_makemodule(fspath, parent):
|
||||
if fspath.name == "test_xyz.py":
|
||||
return MyModule.from_parent(path=fspath, parent=parent)
|
||||
def pytest_pycollect_makemodule(module_path, parent):
|
||||
if module_path.name == "test_xyz.py":
|
||||
return MyModule.from_parent(path=module_path, parent=parent)
|
||||
"""
|
||||
)
|
||||
pytester.makepyfile("def test_some(): pass")
|
||||
@@ -913,9 +913,9 @@ class TestConftestCustomization:
|
||||
return Loader()
|
||||
sys.meta_path.append(Finder())
|
||||
|
||||
def pytest_collect_file(fspath, parent):
|
||||
if fspath.suffix == ".narf":
|
||||
return Module.from_parent(path=fspath, parent=parent)"""
|
||||
def pytest_collect_file(file_path, parent):
|
||||
if file_path.suffix == ".narf":
|
||||
return Module.from_parent(path=file_path, parent=parent)"""
|
||||
)
|
||||
pytester.makefile(
|
||||
".narf",
|
||||
|
||||
Reference in New Issue
Block a user