[TEST] use clean db in postgres tests (#1928)
This commit is contained in:
parent
bda054415a
commit
c29e7a1759
2 changed files with 37 additions and 2 deletions
|
|
@ -2,7 +2,7 @@ import asyncio
|
|||
|
||||
import uvloop
|
||||
|
||||
uvloop.install() # noqa
|
||||
uvloop.install()
|
||||
|
||||
import pytest
|
||||
import pytest_asyncio
|
||||
|
|
@ -16,7 +16,12 @@ from lnbits.core.services import update_wallet_balance
|
|||
from lnbits.core.views.api import api_payments_create_invoice
|
||||
from lnbits.db import Database
|
||||
from lnbits.settings import settings
|
||||
from tests.helpers import get_hold_invoice, get_random_invoice_data, get_real_invoice
|
||||
from tests.helpers import (
|
||||
clean_database,
|
||||
get_hold_invoice,
|
||||
get_random_invoice_data,
|
||||
get_real_invoice,
|
||||
)
|
||||
|
||||
# override settings for tests
|
||||
settings.lnbits_admin_extensions = []
|
||||
|
|
@ -35,6 +40,7 @@ def event_loop():
|
|||
# use session scope to run once before and once after all tests
|
||||
@pytest_asyncio.fixture(scope="session")
|
||||
async def app():
|
||||
clean_database(settings)
|
||||
app = create_app()
|
||||
await app.router.startup()
|
||||
yield app
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue