mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Checking database name directly.
This commit is contained in:
parent
b9606c1b31
commit
ad53cec428
1 changed files with 1 additions and 1 deletions
|
|
@ -72,7 +72,7 @@ def get_db_context() -> Tuple[create_engine, Session]:
|
|||
Get a DB engine and session.
|
||||
"""
|
||||
local_engine, session = _get_db_session()
|
||||
if PYTEST and 'wrolpi_testing' not in str(local_engine.url):
|
||||
if PYTEST and not local_engine.url.database.startswith('wrolpi_testing_'):
|
||||
raise ValueError(f'Running tests, but a test database is not being used!! {local_engine.url=}')
|
||||
return local_engine, session
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue