Skip to content

Commit 6dbe144

Browse files
committed
tests: use Path.unlink(missing_ok=True) to remove file safely
1 parent 1e40988 commit 6dbe144

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

tests/test_cli.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ def _create_test_module(**namespace: Any) -> None:
6161
def empty_last_conversation_path(tmp_path: Path, mocker: MockerFixture) -> Path:
6262
path = tmp_path / LAST_CONVERSATION_FILENAME
6363
mocker.patch('pydantic_ai._cli.PYDANTIC_AI_HOME', tmp_path)
64-
65-
if path.exists():
66-
path.unlink()
64+
path.unlink(missing_ok=True)
6765

6866
return path
6967

0 commit comments

Comments
 (0)