We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f4fcbf commit 45b3cbbCopy full SHA for 45b3cbb
pandas/tests/io/parser/test_common.py
@@ -974,6 +974,15 @@ def test_no_permission(all_parsers):
974
msg = r"\[Errno 13\]"
975
with tm.ensure_clean() as path:
976
os.chmod(path, 0) # make file unreadable
977
+
978
+ # verify that this process cannot open the file (not running as sudo)
979
+ try:
980
+ with open(path):
981
+ pass
982
+ pytest.skip("Running as sudo.")
983
+ except PermissionError:
984
985
986
with pytest.raises(PermissionError, match=msg) as e:
987
parser.read_csv(path)
988
assert path == e.value.filename
0 commit comments