Skip to content

Commit

Permalink
make fixtures modular
Browse files Browse the repository at this point in the history
  • Loading branch information
Lopkop committed May 14, 2024
1 parent d806378 commit 19ea23c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/api/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from db.dbapi import DatabaseService


@pytest.fixture()
@pytest.fixture(scope='module')
def postgres():
from config import settings
from db.database import _create_tables
Expand All @@ -19,7 +19,7 @@ def postgres():
drop_database(settings.DATABASE_URL)


@pytest.fixture
@pytest.fixture(scope='module')
def db_connection(postgres):
engine = create_engine(postgres,
pool_size=10,
Expand All @@ -37,7 +37,7 @@ def db_connection(postgres):
engine.dispose()


@pytest.fixture
@pytest.fixture(scope='module')
def fill_db(db_connection):
db_connection[0].execute(
"INSERT INTO users (name,hashed_password,lifetime) "
Expand Down

0 comments on commit 19ea23c

Please sign in to comment.