Skip to content

Commit 3aaad97

Browse files
committed
rename func to start with "test"; revert removed random test func
1 parent 9e1ba27 commit 3aaad97

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

pandas/tests/io/test_common.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,15 +630,25 @@ def test_fail_mmap():
630630
icom.get_handle(buffer, "rb", memory_map=True)
631631

632632

633-
def read_chained_urls_no_errors():
633+
def test_close_on_error():
634+
# GH 47136
635+
class TestError:
636+
def close(self):
637+
raise OSError("test")
638+
639+
with pytest.raises(OSError, match="test"):
640+
with BytesIO() as buffer:
641+
with icom.get_handle(buffer, "rb") as handles:
642+
handles.created_handles.append(TestError())
643+
644+
def test_read_csv_chained_url_no_error():
634645
tar_file = "pandas/tests/io/data/tar/test-csv.tar"
635646
try:
636647
pd.read_csv(f"tar://test.csv::file://{tar_file}", compression=None)
637648
pd.read_csv(f"tar://test.csv::file://{tar_file}", compression="infer")
638649
except Exception as e:
639650
pytest.fail(e)
640651

641-
642652
@pytest.mark.parametrize(
643653
"reader",
644654
[

0 commit comments

Comments
 (0)