Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pytest_collect_file hook to remove deprecated path argument #112

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

henry0312
Copy link
Owner

Replaced the deprecated path argument with file_path: pathlib.Path in the pytest_collect_file hook to address PytestRemovedIn9Warning.

tests/test_pytest_pycodestyle.py: 10 warnings
  /home/runner/work/pytest-pycodestyle/pytest-pycodestyle/src/pytest_pycodestyle.py:22: PytestRemovedIn9Warning: The (path: py.path.local) argument is deprecated, please use (file_path: pathlib.Path)
  see https://docs.pytest.org/en/latest/deprecations.html#py-path-local-arguments-for-hooks-replaced-with-pathlib-path
    def pytest_collect_file(file_path: pathlib.Path, path, parent):

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

Replaced the deprecated `path` argument with `file_path: pathlib.Path` in the `pytest_collect_file` hook to address PytestRemovedIn9Warning.

```
tests/test_pytest_pycodestyle.py: 10 warnings
  /home/runner/work/pytest-pycodestyle/pytest-pycodestyle/src/pytest_pycodestyle.py:22: PytestRemovedIn9Warning: The (path: py.path.local) argument is deprecated, please use (file_path: pathlib.Path)
  see https://docs.pytest.org/en/latest/deprecations.html#py-path-local-arguments-for-hooks-replaced-with-pathlib-path
    def pytest_collect_file(file_path: pathlib.Path, path, parent):

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
```
@henry0312 henry0312 merged commit c137e1c into master Oct 10, 2024
6 checks passed
@henry0312 henry0312 deleted the fix_warnings branch October 10, 2024 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant