Skip to content

Commit

Permalink
Always create external test DB
Browse files Browse the repository at this point in the history
  • Loading branch information
jirik committed Jan 17, 2023
1 parent a6bdab7 commit 13a447b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions test_tools/external_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@

@pytest.fixture(scope="session")
def ensure_db():
query = f"SELECT count(*) FROM pg_database WHERE datname = %s"
statement = f"""CREATE DATABASE {EXTERNAL_DB_NAME} TEMPLATE {settings.LAYMAN_PG_TEMPLATE_DBNAME}"""

with app.app_context():
res = db_util.run_query(query, (EXTERNAL_DB_NAME,))
if not res[0][0] == 1:
db_util.run_statement(statement)
db_util.run_statement(statement)

yield

Expand Down

0 comments on commit 13a447b

Please sign in to comment.