Skip to content

Commit

Permalink
handle un-analyzable files in coverage run (#24800)
Browse files Browse the repository at this point in the history
fixes #24703
  • Loading branch information
eleanorjboyd authored Feb 7, 2025
1 parent 0983657 commit b4aa112
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python_files/vscode_pytest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,11 @@ def pytest_sessionfinish(session, exitstatus):
except NoSource:
# as per issue 24308 this best way to handle this edge case
continue
except Exception as e:
print(
f"Plugin error[vscode-pytest]: Skipping analysis of file: {file} due to error: {e}"
)
continue
lines_executable = {int(line_no) for line_no in analysis[1]}
lines_missed = {int(line_no) for line_no in analysis[3]}
lines_covered = lines_executable - lines_missed
Expand Down

0 comments on commit b4aa112

Please sign in to comment.