We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fd24e7b commit 32606c2Copy full SHA for 32606c2
1 file changed
tests/unit/synapseclient/services/unit_test_migration_and_types_async.py
@@ -224,7 +224,8 @@ def _populate_db(db_path: str) -> None:
224
128,
225
),
226
]
227
- with sqlite3.connect(db_path) as conn:
+ conn = sqlite3.connect(db_path)
228
+ try:
229
cursor = conn.cursor()
230
_ensure_schema(cursor)
231
cursor.executemany(
@@ -236,12 +237,14 @@ def _populate_db(db_path: str) -> None:
236
237
rows,
238
)
239
conn.commit()
240
+ finally:
241
+ conn.close()
242
243
244
@pytest.fixture
245
def result_db():
- with tempfile.NamedTemporaryFile(suffix=".db", delete=False) as f:
- path = f.name
246
+ fd, path = tempfile.mkstemp(suffix=".db")
247
+ os.close(fd)
248
_populate_db(path)
249
yield path
250
os.unlink(path)
0 commit comments