Skip to content

Commit

Permalink
do not dispose conftests
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Nov 4, 2024
1 parent 035e956 commit 7355fc3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cashu/core/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ def _is_lock_exception(e):
session: AsyncSession = self.async_session() # type: ignore
try:
logger.trace(f"Connecting to database trial: {trial} ({random_int})")
async with session.begin(): # type: ignore
async with session.begin() as txn: # type: ignore
logger.trace("Connected to database. Starting transaction")
wconn = Connection(session, None, self.type, self.name, self.schema)
wconn = Connection(session, txn, self.type, self.name, self.schema)
if lock_table:
await self.acquire_lock(
wconn, lock_table, lock_select_statement
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ async def start_mint_init(ledger: Ledger) -> Ledger:
# drop all tables
await conn.execute("DROP SCHEMA public CASCADE;")
await conn.execute("CREATE SCHEMA public;")
await db.engine.dispose()
# await db.engine.dispose()

wallets_module = importlib.import_module("cashu.lightning")
lightning_backend_sat = getattr(wallets_module, settings.mint_backend_bolt11_sat)(
Expand Down

0 comments on commit 7355fc3

Please sign in to comment.