mirror of
https://github.com/simonw/datasette.git
synced 2026-05-31 22:27:00 +02:00
parent
c0153386ef
commit
d23b32c3e5
4 changed files with 5 additions and 14 deletions
|
|
@ -22,12 +22,7 @@ def ds_write(tmp_path_factory):
|
|||
ds = Datasette([db_path], immutables=[db_path_immutable])
|
||||
ds.root_enabled = True
|
||||
yield ds
|
||||
# Close both setup connections plus any Datasette-managed connections.
|
||||
db1.close()
|
||||
db2.close()
|
||||
for database in ds.databases.values():
|
||||
if not database.is_memory:
|
||||
database.close()
|
||||
ds.close()
|
||||
|
||||
|
||||
def write_token(ds, actor_id="root", permissions=None):
|
||||
|
|
|
|||
|
|
@ -52,10 +52,7 @@ def ds_ct(tmp_path_factory):
|
|||
)
|
||||
ds.root_enabled = True
|
||||
yield ds
|
||||
db.close()
|
||||
for database in ds.databases.values():
|
||||
if not database.is_memory:
|
||||
database.close()
|
||||
ds.close()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
|
@ -95,10 +92,7 @@ def ds_ct_editor_permission(tmp_path_factory):
|
|||
)
|
||||
ds.root_enabled = True
|
||||
yield ds
|
||||
db.close()
|
||||
for database in ds.databases.values():
|
||||
if not database.is_memory:
|
||||
database.close()
|
||||
ds.close()
|
||||
|
||||
|
||||
def write_token(ds, actor_id="root", permissions=None):
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ async def datasette_with_plugin():
|
|||
yield datasette
|
||||
finally:
|
||||
datasette.pm.unregister(name="undo")
|
||||
datasette.close()
|
||||
# -- end datasette_with_plugin_fixture --
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -505,6 +505,7 @@ def ds_with_event_tracking(tmp_path):
|
|||
ds.track_event = recording_track_event
|
||||
|
||||
yield ds
|
||||
ds.close()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue