Skip to content

Commit 216cdf0

Browse files
Add regression test
1 parent 372a358 commit 216cdf0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pandas/tests/io/parser/test_common.py

+12
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,18 @@ def test_nonexistent_path(all_parsers):
969969
assert path == filename
970970

971971

972+
def test_no_permission(all_parsers):
973+
# GH 23784
974+
parser = all_parsers
975+
976+
msg = r"\[Errno 13\]"
977+
with tm.ensure_clean() as path:
978+
os.chmod(path, 0) # make file unreadable
979+
with pytest.raises(PermissionError, match=msg) as e:
980+
parser.read_csv(path)
981+
assert path == e.value.filename
982+
983+
972984
def test_missing_trailing_delimiters(all_parsers):
973985
parser = all_parsers
974986
data = """A,B,C,D

0 commit comments

Comments
 (0)