We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 699100f commit 5bac379Copy full SHA for 5bac379
1 file changed
tests/conftest.py
@@ -267,10 +267,18 @@ def spark():
267
268
269
@pytest.fixture(scope='function')
270
-def duckdb_cursor():
271
- connection = duckdb.connect('')
272
- yield connection
273
- connection.close()
+def duckdb_cursor(tmp_path):
+ with duckdb.connect(tmp_path / "mytest") as connection:
+ yield connection
+
274
275
+@pytest.fixture(scope='function')
276
+def default_con():
277
+ # ensures each test uses a fresh default connection to avoid test leakage
278
+ # threading_unsafe fixture
279
+ duckdb.default_connection().close()
280
+ with duckdb.default_connection() as conn:
281
+ yield conn
282
283
284
0 commit comments