File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -1793,18 +1793,14 @@ def test_commandresult_falsy(commandresult_app):
1793
1793
assert commandresult_app .last_result == cmd2 .CommandResult ('' , arg )
1794
1794
1795
1795
1796
- def test_is_text_file_bad_input (base_app ):
1797
- # Test with a non-existent file - on GitHub Actions Windows test runners, we get a PermissionError
1798
- file_name = 'does_not_exist.txt'
1799
- if sys .platform .startswith ('win' ):
1800
- # For Windows, depending on setup you might get a FileNotFoundError or a PermissionError
1801
- with pytest .raises (OSError ): # noqa: PT011
1802
- utils .is_text_file (file_name )
1803
- else :
1804
- # For Linux or macOS you should reliably get a FileNotFoundError
1805
- with pytest .raises (FileNotFoundError ):
1806
- utils .is_text_file (file_name )
1796
+ @pytest .mark .skipif (sys .platform .startswith ('win' ), reason = "Test is unreliable on GitHub Actions Windows runners" )
1797
+ def test_is_text_file_bad_no_exist (base_app ):
1798
+ # Test with a non-existent file
1799
+ with pytest .raises (FileNotFoundError ):
1800
+ utils .is_text_file ('does_not_exist.txt' )
1801
+
1807
1802
1803
+ def test_is_text_file_bad_is_dir (base_app ):
1808
1804
# Test with a directory
1809
1805
with pytest .raises (IsADirectoryError ):
1810
1806
utils .is_text_file ('.' )
You can’t perform that action at this time.
0 commit comments