Skip to content

Commit e8d5df9

Browse files
authored
Merge pull request #189 from JAlvarezJarreta/release_2.0.2
Make pytest_collect_file() compatible with pytest 8.1+
2 parents dd69ee7 + 8386a25 commit e8d5df9

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

HISTORY.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
Changelog
33
==========
44

5+
version 2.0.2
6+
---------------------------
7+
+ Fixed a bug where pytest 8.1+ would raise a ``PluginValidationError`` because
8+
the hook ``pytest_collect_file()`` has finally dropped the deprecated
9+
argument ``path`` from its specification.
10+
511
.. Newest changes should be on top.
612
713
.. This document is user facing. Please word the changes in such a way

src/pytest_workflow/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ def addoption(self, *args, **kwargs):
117117
return parser
118118

119119

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

0 commit comments

Comments
 (0)