Move pytest test IDs file deletion to finally block by itaihay · Pull Request #25540 · microsoft/vscode-python
marked this pull request as ready for review
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.
eleanorjboyd
added
the
debt
label
Nov 10, 2025This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters