Skip to content

Commit 03facc3

Browse files
fix(tests): improve exception handling in integration test for conditional imports
- Enhanced exception handling in the `run_integration_test` function by specifying `FileNotFoundError` and `OSError` in the exception clause, ensuring more precise error management. - This update prevents potential silent failures when attempting to unlink temporary files, improving the robustness of the integration tests for conditional imports.
1 parent 23dc35d commit 03facc3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/test_integration_conditional_imports.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
"""
1414

1515
import sys
16-
import subprocess
1716
import tempfile
1817
import textwrap
19-
from pathlib import Path
18+
import subprocess
2019
from typing import List, Tuple
20+
from pathlib import Path
2121

2222
# Note: pytest is imported automatically when running via pytest
2323
# This file can also be run standalone for manual testing
@@ -205,7 +205,7 @@ def run_integration_test(module_name: str, dependencies: List[str]) -> Tuple[boo
205205
try:
206206
Path(blocker_script).unlink()
207207
Path(test_script).unlink()
208-
except:
208+
except (FileNotFoundError, OSError):
209209
pass
210210

211211

0 commit comments

Comments
 (0)