tests: Fix a warning with pytest setup

The path attribute has been deprecated and will be removed in pytest 9.0. The
new argument to use is collection_path which is pathlib.Path object it is
available in pytest 7.2 (bookworm) and above.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2025-03-25 15:00:37 -07:00 committed by James Valleroy
parent 70ed89eff9
commit 73ded6b3ad
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -17,9 +17,9 @@ except ImportError:
_functional_libs_available = False
def pytest_ignore_collect(path, config):
def pytest_ignore_collect(collection_path, config):
"""Ignore functional tests when splinter is not available."""
if path.basename == 'test_functional.py':
if collection_path.name == 'test_functional.py':
return not _functional_libs_available