Skip to content

Commit

Permalink
Add conftest and update requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
taxe10 committed Jun 5, 2024
1 parent d0337b7 commit a39cc3b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ dependencies = [
"pandas",
"numpy",
"python-dotenv",
"prefect-client==2.14.21"
"prefect-client==2.14.21",
"tiled[client]==0.1.0a118",
]

[project.optional-dependencies]
Expand All @@ -42,7 +43,7 @@ dev = [
"flake8",
"pre-commit",
"pytest-mock",
"tiled[all]",
"tiled[all]==0.1.0a118",
]

simulator = [
Expand Down
26 changes: 26 additions & 0 deletions src/test/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import pytest
from tiled.catalog import from_uri
from tiled.client import Context
from tiled.server.app import build_app


@pytest.fixture
def catalog(tmpdir):
adapter = from_uri(
f"sqlite+aiosqlite:///{tmpdir}/catalog.db",
writable_storage=str(tmpdir),
init_if_not_exists=True,
)
yield adapter


@pytest.fixture
def app(catalog):
app = build_app(catalog)
yield app


@pytest.fixture
def context(app):
with Context.from_app(app) as context:
yield context

0 comments on commit a39cc3b

Please sign in to comment.