Skip to content

Commit

Permalink
handle key error pytest (#22151)
Browse files Browse the repository at this point in the history
fixes #22149
  • Loading branch information
eleanorjboyd authored Oct 4, 2023
1 parent a363381 commit ff0d4df
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pythonFiles/vscode_pytest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,9 @@ def pytest_report_teststatus(report, config):
elif report.failed:
report_value = "failure"
message = report.longreprtext
node_path = map_id_to_path[report.nodeid]
if not node_path:
try:
node_path = map_id_to_path[report.nodeid]
except KeyError:
node_path = cwd
# Calculate the absolute test id and use this as the ID moving forward.
absolute_node_id = get_absolute_test_id(report.nodeid, node_path)
Expand Down

0 comments on commit ff0d4df

Please sign in to comment.