diff --git a/neotest_python/pytest.py b/neotest_python/pytest.py index e9019e0..f7cf7b6 100644 --- a/neotest_python/pytest.py +++ b/neotest_python/pytest.py @@ -44,7 +44,7 @@ class PytestNeotestAdapter(NeotestAdapter): def pytest_deselected(items: List): for report in items: file_path, *name_path = report.nodeid.split("::") - abs_path = str(Path(pytest_config.rootpath, file_path)) + abs_path = str(Path(pytest_config.rootdir, file_path)) test_name, *namespaces = reversed(name_path) valid_test_name, *params = test_name.split("[") # ] pos_id = "::".join([abs_path, *namespaces, valid_test_name]) @@ -72,7 +72,7 @@ class PytestNeotestAdapter(NeotestAdapter): ): return file_path, *name_path = report.nodeid.split("::") - abs_path = str(Path(pytest_config.rootpath, file_path)) + abs_path = str(Path(pytest_config.rootdir, file_path)) test_name, *namespaces = reversed(name_path) valid_test_name, *params = test_name.split("[") # ] pos_id = "::".join([abs_path, *namespaces, valid_test_name])