1- import os
1+ from pathlib import Path
22from unittest .mock import ANY
33
44import pytest
@@ -76,7 +76,7 @@ def test_commit_backup_on_failure(
7676
7777 prompt_mock_feat .assert_called_once ()
7878 error_mock .assert_called_once ()
79- assert os . path . isfile (temp_file )
79+ assert Path (temp_file ). exists ( )
8080
8181
8282@pytest .mark .usefixtures ("staging_is_clean" , "commit_mock" )
@@ -100,7 +100,7 @@ def test_commit_retry_works(
100100 commit_mock .assert_called_with ("backup commit" , args = "" )
101101 prompt_mock .assert_not_called ()
102102 success_mock .assert_called_once ()
103- assert not os . path . isfile (temp_file )
103+ assert not Path (temp_file ). exists ( )
104104
105105
106106@pytest .mark .usefixtures ("staging_is_clean" )
@@ -129,7 +129,7 @@ def test_commit_retry_after_failure_works(
129129 commit_mock .assert_called_with ("backup commit" , args = "" )
130130 prompt_mock .assert_not_called ()
131131 success_mock .assert_called_once ()
132- assert not os . path . isfile (temp_file )
132+ assert not Path (temp_file ). exists ( )
133133
134134
135135@pytest .mark .usefixtures ("staging_is_clean" , "backup_file" )
@@ -144,7 +144,7 @@ def test_commit_retry_after_failure_with_no_retry_works(
144144 commit_mock .assert_called_with ("feat: user created\n \n closes #21" , args = "" )
145145 prompt_mock_feat .assert_called_once ()
146146 success_mock .assert_called_once ()
147- assert not os . path . isfile (temp_file )
147+ assert not Path (temp_file ). exists ( )
148148
149149
150150@pytest .mark .usefixtures ("staging_is_clean" , "prompt_mock_feat" )
0 commit comments