Skip to content

Commit 9e1ba27

Browse files
committed
add tests and test tar file
1 parent cb94060 commit 9e1ba27

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed
10 KB
Binary file not shown.

pandas/tests/io/test_common.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -630,16 +630,13 @@ def test_fail_mmap():
630630
icom.get_handle(buffer, "rb", memory_map=True)
631631

632632

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())
633+
def read_chained_urls_no_errors():
634+
tar_file = "pandas/tests/io/data/tar/test-csv.tar"
635+
try:
636+
pd.read_csv(f"tar://test.csv::file://{tar_file}", compression=None)
637+
pd.read_csv(f"tar://test.csv::file://{tar_file}", compression="infer")
638+
except Exception as e:
639+
pytest.fail(e)
643640

644641

645642
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)