From f174452da320964df5d6026949135d46faddd5e4 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Mon, 29 Jan 2024 22:41:02 +0100 Subject: [PATCH] Fix update to pytest 8.0.0 pytest.PytestRemovedIn8Warning: The (fspath: py.path.local) argument to JupyterNbCollector is deprecated. Please use the (path: pathlib.Path) argument instead --- pytest_notebook/plugin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pytest_notebook/plugin.py b/pytest_notebook/plugin.py index ab9cd3e..a50ccb1 100644 --- a/pytest_notebook/plugin.py +++ b/pytest_notebook/plugin.py @@ -12,6 +12,7 @@ """ import os import shlex +from pathlib import Path import pytest @@ -270,7 +271,7 @@ def pytest_collect_file(path, parent): path.fnmatch(pat) for pat in other_args.get("nb_file_fnmatch", ["*.ipynb"]) ): try: - return JupyterNbCollector.from_parent(parent, fspath=path) + return JupyterNbCollector.from_parent(parent, path=Path(path)) except AttributeError: return JupyterNbCollector(path, parent)