From 34b8fb48e7ad2a47dd4a3bc0d626c68ed075e87b Mon Sep 17 00:00:00 2001 From: mheguy <10162554+mheguy@users.noreply.github.com> Date: Tue, 27 May 2025 16:22:06 -0400 Subject: [PATCH] Replaces direct import of closing with qualified contextlib usage --- pandas/tests/io/test_sql.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pandas/tests/io/test_sql.py b/pandas/tests/io/test_sql.py index ff06d04fc23bd..4a6a5635eb68c 100644 --- a/pandas/tests/io/test_sql.py +++ b/pandas/tests/io/test_sql.py @@ -1,7 +1,6 @@ from __future__ import annotations import contextlib -from contextlib import closing import csv from datetime import ( date, @@ -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)