Skip to content

Commit 6ffd0b3

Browse files
authored
fix: Deprecation warning from pytest, use new path argument in pytest hook (#133)
* fix: use new path argument in pytest hook This fixes a deprecation warning against pytest 9. * chore: update version to 1.20.2 and fix deprecation warnings for pytest * black formatting
1 parent ff2e0af commit 6ffd0b3

5 files changed

Lines changed: 28 additions & 21 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# AnyPyTools Change Log
22

3+
## v1.20.2
4+
5+
* Fixed a deprecation warning from the pytest plugin, and enable pytest 9 support.
6+
7+
38
## v1.20.1
49

510
* Fixed an issue with AnyPyTools when running directly in the main thread

anypytools/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"NORMAL_PRIORITY_CLASS",
3737
]
3838

39-
__version__ = "1.20.1"
39+
__version__ = "1.20.2"
4040

4141

4242
def print_versions():

anypytools/pytest_plugin.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,12 @@ def change_dir(path):
130130
os.chdir(prev_cwd)
131131

132132

133-
def pytest_collect_file(parent, path):
133+
def pytest_collect_file(parent, file_path):
134134
"""Collect AnyScript test files."""
135-
path = Path(path)
136-
if path.suffix.lower() == ".any" and path.stem.lower().startswith("test_"):
137-
return AnyTestFile.from_parent(parent, path=path)
135+
if file_path.suffix.lower() == ".any" and file_path.stem.lower().startswith(
136+
"test_"
137+
):
138+
return AnyTestFile.from_parent(parent, path=file_path)
138139

139140

140141
def _format_switches(defs):

pixi.lock

Lines changed: 15 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pixi.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ anypytools = {path= "."}
1010

1111
[package]
1212
name = "anypytools"
13-
version="1.20.1"
13+
version="1.20.2"
1414

1515
[package.build]
1616
backend = { name = "pixi-build-python", version = "*" }
@@ -57,7 +57,7 @@ ipywidgets = "*"
5757
seaborn = ">=0.13.2,<0.14"
5858

5959
[feature.test.dependencies]
60-
pytest="*"
60+
pytest=">=9"
6161
pytest-xdist = "*"
6262
debugpy = "*"
6363

0 commit comments

Comments
 (0)