Skip to content

Commit eb8b6ad

Browse files
committed
TST: Refactor sql test inheritence
1 parent f99f050 commit eb8b6ad

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

pandas/io/tests/test_sql.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def _close_conn(self):
236236
pass
237237

238238

239-
class PandasSQLTest(unittest.TestCase):
239+
class PandasSQLTest(object):
240240
"""
241241
Base class with common private methods for SQLAlchemy and fallback cases.
242242
@@ -839,7 +839,7 @@ def test_unicode_column_name(self):
839839
df.to_sql('test_unicode', self.conn, index=False)
840840

841841

842-
class TestSQLApi(SQLAlchemyMixIn, _TestSQLApi):
842+
class TestSQLApi(SQLAlchemyMixIn, _TestSQLApi, unittest.TestCase):
843843
"""
844844
Test the public API as it would be used directly
845845
@@ -1018,11 +1018,11 @@ def tearDown(self):
10181018
super(_EngineToConnMixin, self).tearDown()
10191019

10201020

1021-
class TestSQLApiConn(_EngineToConnMixin, TestSQLApi):
1021+
class TestSQLApiConn(_EngineToConnMixin, TestSQLApi, unittest.TestCase):
10221022
pass
10231023

10241024

1025-
class TestSQLiteFallbackApi(SQLiteMixIn, _TestSQLApi):
1025+
class TestSQLiteFallbackApi(SQLiteMixIn, _TestSQLApi, unittest.TestCase):
10261026
"""
10271027
Test the public sqlite connection fallback API
10281028
@@ -1869,34 +1869,39 @@ def test_schema_support(self):
18691869
tm.assert_frame_equal(res1, res2)
18701870

18711871

1872-
class TestMySQLAlchemy(_TestMySQLAlchemy, _TestSQLAlchemy):
1872+
class TestMySQLAlchemy(_TestMySQLAlchemy, _TestSQLAlchemy, unittest.TestCase):
18731873
pass
18741874

18751875

1876-
class TestMySQLAlchemyConn(_TestMySQLAlchemy, _TestSQLAlchemyConn):
1876+
class TestMySQLAlchemyConn(_TestMySQLAlchemy, _TestSQLAlchemyConn,
1877+
unittest.TestCase):
18771878
pass
18781879

18791880

1880-
class TestPostgreSQLAlchemy(_TestPostgreSQLAlchemy, _TestSQLAlchemy):
1881+
class TestPostgreSQLAlchemy(_TestPostgreSQLAlchemy, _TestSQLAlchemy,
1882+
unittest.TestCase):
18811883
pass
18821884

18831885

1884-
class TestPostgreSQLAlchemyConn(_TestPostgreSQLAlchemy, _TestSQLAlchemyConn):
1886+
class TestPostgreSQLAlchemyConn(_TestPostgreSQLAlchemy, _TestSQLAlchemyConn,
1887+
unittest.TestCase):
18851888
pass
18861889

18871890

1888-
class TestSQLiteAlchemy(_TestSQLiteAlchemy, _TestSQLAlchemy):
1891+
class TestSQLiteAlchemy(_TestSQLiteAlchemy, _TestSQLAlchemy,
1892+
unittest.TestCase):
18891893
pass
18901894

18911895

1892-
class TestSQLiteAlchemyConn(_TestSQLiteAlchemy, _TestSQLAlchemyConn):
1896+
class TestSQLiteAlchemyConn(_TestSQLiteAlchemy, _TestSQLAlchemyConn,
1897+
unittest.TestCase):
18931898
pass
18941899

18951900

18961901
# -----------------------------------------------------------------------------
18971902
# -- Test Sqlite / MySQL fallback
18981903

1899-
class TestSQLiteFallback(SQLiteMixIn, PandasSQLTest):
1904+
class TestSQLiteFallback(SQLiteMixIn, PandasSQLTest, unittest.TestCase):
19001905
"""
19011906
Test the fallback mode against an in-memory sqlite database.
19021907

0 commit comments

Comments
 (0)