fix(pytest): use rootdir instead of rootpath

See #21
This commit is contained in:
Rónán Carrigan
2022-10-20 08:03:18 +01:00
parent 15f566a484
commit 8aca335334

View File

@@ -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])