build: add ruff and format code

This commit is contained in:
sam 2024-03-23 01:39:08 +01:00
parent afadffbaac
commit 9d24f79436
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
20 changed files with 122 additions and 60 deletions

View file

@ -1,11 +1,10 @@
import pytest
import pytest_asyncio
from sqlalchemy import text, delete
from sqlalchemy import delete, text
from foxnouns.db import Base
from foxnouns.settings import DATABASE
# Override the database name to the testing database
DATABASE["NAME"] = f"{DATABASE['NAME']}_test"
@ -25,8 +24,8 @@ def pytest_collection_modifyitems(items):
def setup():
"""Migrate the testing database to the latest migration, and once the tests complete, clear the database again."""
from foxnouns.db.sync import engine
from alembic import command, config
from foxnouns.db.sync import engine
cfg = config.Config("alembic.ini")
cfg.attributes["connection"] = engine.connect()