Skip to content

Commit b144cc1

Browse files
Merge pull request #10230 from graingert/fix-testxmysql
Close mysql connection in TestXMySQL to prevent tests freezing
2 parents 1d87174 + cfe4d26 commit b144cc1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/io/tests/test_sql.py

+7
Original file line numberDiff line numberDiff line change
@@ -2195,6 +2195,13 @@ def setUp(self):
21952195
"[pandas] in your system's mysql default file, "
21962196
"typically located at ~/.my.cnf or /etc/.my.cnf. ")
21972197

2198+
def tearDown(self):
2199+
from pymysql.err import Error
2200+
try:
2201+
self.db.close()
2202+
except Error:
2203+
pass
2204+
21982205
def test_basic(self):
21992206
_skip_if_no_pymysql()
22002207
frame = tm.makeTimeDataFrame()

0 commit comments

Comments
 (0)