From 89b1a916594bd6ae16697625159dcff4ff55fe36 Mon Sep 17 00:00:00 2001 From: Jason Solomon Date: Tue, 17 Nov 2020 12:48:00 +1100 Subject: [PATCH] postgresql datastore tests --- dfdewey/datastore/postgresql_test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dfdewey/datastore/postgresql_test.py b/dfdewey/datastore/postgresql_test.py index 7ec56a9..a5aac6d 100644 --- a/dfdewey/datastore/postgresql_test.py +++ b/dfdewey/datastore/postgresql_test.py @@ -31,7 +31,7 @@ class PostgresqlTest(unittest.TestCase): """ with mock.patch('psycopg2.connect') as _: db = PostgresqlDataStore(autocommit=True) - return db + return db @mock.patch('psycopg2.extras.execute_values') def test_bulk_insert(self, _): @@ -70,7 +70,8 @@ class PostgresqlTest(unittest.TestCase): def test_switch_database(self): """Test switch database method.""" db = self._get_datastore() - db.switch_database(db_name='dfdewey', autocommit=True) + with mock.patch('psycopg2.connect') as _: + db.switch_database(db_name='dfdewey', autocommit=True) def test_table_exists(self): """Test table exists method."""