diff --git a/tests/test_task.py b/tests/test_task.py index 4781e4b..8a8df94 100644 --- a/tests/test_task.py +++ b/tests/test_task.py @@ -433,10 +433,12 @@ def test_task_chain_single_thread(self): # was a duplicate database_path = os.path.join( self.workspace_dir, taskgraph._TASKGRAPH_DATABASE_FILENAME) - with sqlite3.connect(database_path) as conn: + conn = sqlite3.connect(database_path) + with conn: cursor = conn.cursor() cursor.execute("SELECT * FROM taskgraph_data") result = cursor.fetchall() + conn.close() self.assertEqual(len(result), 4) def test_task_broken_chain(self): @@ -527,10 +529,13 @@ def test_empty_task(self): # we shouldn't have anything in the database database_path = os.path.join( self.workspace_dir, taskgraph._TASKGRAPH_DATABASE_FILENAME) - with sqlite3.connect(database_path) as conn: + + conn = sqlite3.connect(database_path) + with conn: cursor = conn.cursor() cursor.executescript("SELECT * FROM taskgraph_data") result = cursor.fetchall() + conn.close() self.assertEqual(len(result), 0) def test_closed_graph(self):