Skip to content

Commit 3174de9

Browse files
committed
In tests with multiple databases, use file to avoid colliding in-memory.
1 parent 245b5f7 commit 3174de9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tiled/_tests/test_sync.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import asyncio
22
import contextlib
33
import tempfile
4+
from pathlib import Path
45

56
import awkward
67
import h5py
@@ -10,7 +11,7 @@
1011
import sparse
1112
import tifffile
1213

13-
from tiled.catalog import in_memory
14+
from tiled.catalog import from_uri
1415
from tiled.client import Context, from_context
1516
from tiled.client.register import register
1617
from tiled.client.smoke import read
@@ -23,8 +24,11 @@
2324
@contextlib.contextmanager
2425
def client_factory(readable_storage=None):
2526
with tempfile.TemporaryDirectory() as tempdir:
26-
catalog = in_memory(
27-
writable_storage=str(tempdir), readable_storage=readable_storage
27+
catalog = from_uri(
28+
Path(tempdir, "catalog.db"),
29+
writable_storage=str(tempdir),
30+
readable_storage=readable_storage,
31+
init_if_not_exists=True,
2832
)
2933
app = build_app(catalog)
3034
with Context.from_app(app) as context:

0 commit comments

Comments
 (0)