Skip to content

Commit

Permalink
Merge pull request #189 from JAlvarezJarreta/release_2.0.2
Browse files Browse the repository at this point in the history
Make pytest_collect_file() compatible with pytest 8.1+
  • Loading branch information
rhpvorderman authored Mar 4, 2024
2 parents dd69ee7 + 8386a25 commit e8d5df9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
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

0 comments on commit e8d5df9

Please sign in to comment.