Skip to content

Commit 97897e1

Browse files
authored
CLN Replace direct import of closing with qualified contextlib usage (#61506)
Replaces direct import of closing with qualified contextlib usage
1 parent 71885ec commit 97897e1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pandas/tests/io/test_sql.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
import contextlib
4-
from contextlib import closing
54
import csv
65
from datetime import (
76
date,
@@ -2580,10 +2579,10 @@ def test_sql_open_close(test_frame3):
25802579
# between the writing and reading (as in many real situations).
25812580

25822581
with tm.ensure_clean() as name:
2583-
with closing(sqlite3.connect(name)) as conn:
2582+
with contextlib.closing(sqlite3.connect(name)) as conn:
25842583
assert sql.to_sql(test_frame3, "test_frame3_legacy", conn, index=False) == 4
25852584

2586-
with closing(sqlite3.connect(name)) as conn:
2585+
with contextlib.closing(sqlite3.connect(name)) as conn:
25872586
result = sql.read_sql_query("SELECT * FROM test_frame3_legacy;", conn)
25882587

25892588
tm.assert_frame_equal(test_frame3, result)

0 commit comments

Comments
 (0)