Skip to content

Commit 399badf

Browse files
committed
force absolute path for coverage results
1 parent 18efcd6 commit 399badf

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)