Skip to content

Commit cd714bf

Browse files
authored
force absolute path for coverage results (#24948)
fixes #24943
1 parent affbd1b commit cd714bf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

python_files/vscode_pytest/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,9 @@ def pytest_sessionfinish(session, exitstatus):
474474
"lines_covered": list(lines_covered), # list of int
475475
"lines_missed": list(lines_missed), # list of int
476476
}
477+
# convert relative path to absolute path
478+
if not pathlib.Path(file).is_absolute():
479+
file = str(pathlib.Path(file).resolve())
477480
file_coverage_map[file] = file_info
478481

479482
payload: CoveragePayloadDict = CoveragePayloadDict(

0 commit comments

Comments
 (0)