Skip to content

Conversation

@itaihay
Copy link

@itaihay itaihay commented Oct 22, 2025

If the vscode-pytest execution is wrapped and re-triggered then the deletion of the file causes the second run the fail. Deleting the file on the finally block ensures that the pytest execution will work even if re-run.

  • Move the deletion of the test IDs temp file from before pytest execution to a finally block.
  • This ensures the temp file is always cleaned up, even if pytest execution fails or an exception occurs.
  • Move ids_path initialization outside the try block so it's accessible in the finally block for cleanup.

context: #15669

If the vscode-pytest execution is wrapped and re-triggered then
the deletion of the file causes the second run the fail.
Deleting the file on the finally block ensures that the pytest
execution will work even if re-run.

- Move the deletion of the test IDs temp file from before pytest
  execution to a `finally` block.
- This ensures the temp file is always cleaned up, even if pytest
  execution fails or an exception occurs.
- Move `ids_path` initialization outside the try block so it's
  accessible in the finally block for cleanup.
@itaihay itaihay marked this pull request as ready for review October 22, 2025 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant