forked from pool/python-pytest-black
https://docs.pytest.org/en/latest/deprecations.html#py-path-local-arguments-for-hooks-replaced-with-pathlib-path
17 lines
572 B
Diff
17 lines
572 B
Diff
Index: pytest_black-0.6.0/pytest_black.py
|
|
===================================================================
|
|
--- pytest_black-0.6.0.orig/pytest_black.py
|
|
+++ pytest_black-0.6.0/pytest_black.py
|
|
@@ -20,9 +20,9 @@ def pytest_addoption(parser):
|
|
)
|
|
|
|
|
|
-def pytest_collect_file(file_path, path, parent):
|
|
+def pytest_collect_file(file_path, parent):
|
|
config = parent.config
|
|
- if config.option.black and path.ext in [".py", ".pyi"]:
|
|
+ if config.option.black and file_path.suffix in [".py", ".pyi"]:
|
|
return BlackFile.from_parent(parent, path=file_path)
|
|
|
|
|