We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 05dc6fb commit c54c9eaCopy full SHA for c54c9ea
1 file changed
tests/test_cmd2.py
@@ -5,7 +5,6 @@
5
import builtins
6
import io
7
import os
8
-import pathlib
9
import signal
10
import sys
11
import tempfile
@@ -1795,12 +1794,9 @@ def test_commandresult_falsy(commandresult_app):
1795
1794
1796
1797
def test_is_text_file_bad_input(base_app):
1798
- # Test with a non-existent file
1799
- home_dir = pathlib.Path.home()
1800
- file_path = home_dir / 'does_not_exist'
1801
- file_str = f'{file_path}'
1802
- with pytest.raises(FileNotFoundError):
1803
- utils.is_text_file(file_str)
+ # Test with a non-existent file - on GitHub Actions Windows test runners, we get a PermissionError
+ with pytest.raises((FileNotFoundError, PermissionError)):
+ utils.is_text_file('does_not_exist.txt')
1804
1805
# Test with a directory
1806
with pytest.raises(IsADirectoryError):
0 commit comments