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

Make pytest_collect_file() compatible with pytest 8.1+ #189

Merged
merged 2 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
Changelog
==========

version 2.0.2
---------------------------
+ Fixed a bug where pytest 8.1+ would raise a ``PluginValidationError`` because
the hook ``pytest_collect_file()`` has finally dropped the deprecated
argument ``path`` from its specification.

.. Newest changes should be on top.

.. This document is user facing. Please word the changes in such a way
Expand Down
4 changes: 2 additions & 2 deletions src/pytest_workflow/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ def addoption(self, *args, **kwargs):
return parser


def pytest_collect_file(file_path, path, parent):
def pytest_collect_file(file_path, parent):
"""Collection hook
This collects the yaml files that start with "test" and end with
.yaml or .yml"""
if path.ext in [".yml", ".yaml"] and path.basename.startswith("test"):
if file_path.suffix in [".yml", ".yaml"] and file_path.name.startswith("test"):
return YamlFile.from_parent(parent, path=file_path)
return None

Expand Down
Loading