Skip to content

Commit 912eec1

Browse files
authored
GH-48419: [Python] Fix test_parquet_file_too_small to catch only ArrowInvalid (#48420)
### Rationale for this change The test does not throw `OSError` anymore. ### What changes are included in this PR? This PR changes `test_parquet_file_too_small` test to only catch `ArrowInvalid`. ### Are these changes tested? Yes, manually tested via ``` pytest pyarrow/tests/parquet/test_basic.py::test_parquet_file_too_small ``` ### Are there any user-facing changes? No, test-only. * GitHub Issue: #48419 Authored-by: Hyukjin Kwon <[email protected]> Signed-off-by: Raúl Cumplido <[email protected]>
1 parent 9492e6b commit 912eec1

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

python/pyarrow/tests/parquet/test_basic.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -713,15 +713,12 @@ def test_zlib_compression_bug():
713713

714714
def test_parquet_file_too_small(tempdir):
715715
path = str(tempdir / "test.parquet")
716-
# TODO(dataset) with datasets API it raises OSError instead
717-
with pytest.raises((pa.ArrowInvalid, OSError),
718-
match='size is 0 bytes'):
716+
with pytest.raises(pa.ArrowInvalid, match='size is 0 bytes'):
719717
with open(path, 'wb') as f:
720718
pass
721719
pq.read_table(path)
722720

723-
with pytest.raises((pa.ArrowInvalid, OSError),
724-
match='size is 4 bytes'):
721+
with pytest.raises(pa.ArrowInvalid, match='size is 4 bytes'):
725722
with open(path, 'wb') as f:
726723
f.write(b'ffff')
727724
pq.read_table(path)

0 commit comments

Comments
 (0)