fix(pytest): handle parameterized tests without pytest discovery

Only emits position IDs with parameters when pytest discovery is enabled

See #36 and #59
This commit is contained in:
Rónán Carrigan
2023-12-20 18:49:01 +00:00
parent 48bf141103
commit 27a2676aa0
5 changed files with 59 additions and 28 deletions

View File

@@ -17,7 +17,7 @@ class UnittestNeotestAdapter(NeotestAdapter):
return str(Path(inspect.getmodule(case).__file__).absolute()) # type: ignore
def case_id_elems(self, case) -> List[str]:
if case.__class__.__name__ == '_SubTest':
if case.__class__.__name__ == "_SubTest":
case = case.test_case
file = self.case_file(case)
elems = [file, case.__class__.__name__]