-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add conftest and update requirements
- Loading branch information
Showing
2 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |