Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions pandas/tests/io/test_sql.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

import contextlib
from contextlib import closing
import csv
from datetime import (
date,
Expand Down Expand Up @@ -2580,10 +2579,10 @@ def test_sql_open_close(test_frame3):
# between the writing and reading (as in many real situations).

with tm.ensure_clean() as name:
with closing(sqlite3.connect(name)) as conn:
with contextlib.closing(sqlite3.connect(name)) as conn:
assert sql.to_sql(test_frame3, "test_frame3_legacy", conn, index=False) == 4

with closing(sqlite3.connect(name)) as conn:
with contextlib.closing(sqlite3.connect(name)) as conn:
result = sql.read_sql_query("SELECT * FROM test_frame3_legacy;", conn)

tm.assert_frame_equal(test_frame3, result)
Expand Down
Loading