From cfe4d2606f13eb5f5f2d9523b32a088763746beb Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Wed, 27 May 2015 17:09:28 +0100 Subject: [PATCH] Close mysql connection in TestXMySQL to prevent tests freezing --- pandas/io/tests/test_sql.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pandas/io/tests/test_sql.py b/pandas/io/tests/test_sql.py index fa7debeb228ce..9576f80696350 100644 --- a/pandas/io/tests/test_sql.py +++ b/pandas/io/tests/test_sql.py @@ -2195,6 +2195,13 @@ def setUp(self): "[pandas] in your system's mysql default file, " "typically located at ~/.my.cnf or /etc/.my.cnf. ") + def tearDown(self): + from pymysql.err import Error + try: + self.db.close() + except Error: + pass + def test_basic(self): _skip_if_no_pymysql() frame = tm.makeTimeDataFrame()