Add tests for poll creation
This commit is contained in:
parent
4d0f439c8c
commit
c8bd23b696
2 changed files with 140 additions and 4 deletions
|
@ -24,10 +24,12 @@ async def async_db_session():
|
|||
@pytest.fixture
|
||||
def db() -> Generator:
|
||||
Base.metadata.create_all(bind=engine)
|
||||
try:
|
||||
yield _Session
|
||||
finally:
|
||||
Base.metadata.drop_all(bind=engine)
|
||||
with _Session() as db_session:
|
||||
try:
|
||||
yield db_session
|
||||
finally:
|
||||
db_session.close()
|
||||
Base.metadata.drop_all(bind=engine)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue