-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Session_model doesn't need validation
- Loading branch information
1 parent
c36f4f8
commit 3bc1e1d
Showing
3 changed files
with
7 additions
and
12 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
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 |
---|---|---|
@@ -1,25 +1,22 @@ | ||
import pytest_asyncio | ||
import tempfile | ||
|
||
import pytest_asyncio | ||
|
||
from seplis_play_server import config | ||
from seplis_play_server.logger import set_logger | ||
|
||
|
||
@pytest_asyncio.fixture(scope="function") | ||
async def play_db_test(): | ||
from seplis_play_server.database import database | ||
from seplis_play_server import scan | ||
from seplis_play_server.database import database | ||
|
||
set_logger("play_test") | ||
config.test = True | ||
config.server_id = "123" | ||
with tempfile.TemporaryDirectory() as dir: | ||
import logging | ||
logging.error(f"Using temp dir: {dir}") | ||
config.database = f"sqlite:///{dir}/db.sqlite" | ||
scan.upgrade_scan_db() | ||
logging.error(f"Using database: {config.database}") | ||
database.setup() | ||
logging.error("Database setup") | ||
yield database | ||
logging.error("Closing database") | ||
await database.close() |