• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vintasoftware / nextjs-fastapi-template / 12169631430

04 Dec 2024 10:43PM UTC coverage: 97.951% (+0.01%) from 97.939%
12169631430

Pull #36

github

web-flow
Merge 22a1261fc into ee6d93e12
Pull Request #36: Added suspense to confirmation page

78 of 82 branches covered (95.12%)

Branch coverage included in aggregate %.

56 of 56 new or added lines in 1 file covered. (100.0%)

1404 of 1431 relevant lines covered (98.11%)

6.63 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

68.75
/fastapi_backend/app/database.py
1
from typing import AsyncGenerator
1✔
2

3
from fastapi import Depends
1✔
4
from fastapi_users.db import SQLAlchemyUserDatabase
1✔
5
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine
1✔
6

7
from .config import settings
1✔
8
from .models import Base, User
1✔
9

10
engine = create_async_engine(settings.DATABASE_URL)
1✔
11

12
async_session_maker = async_sessionmaker(
1✔
13
    engine, expire_on_commit=settings.EXPIRE_ON_COMMIT
14
)
15

16

17
async def create_db_and_tables():
1✔
18
    async with engine.begin() as conn:
×
19
        await conn.run_sync(Base.metadata.create_all)
×
20

21

22
async def get_async_session() -> AsyncGenerator[AsyncSession, None]:
1✔
23
    async with async_session_maker() as session:
×
24
        yield session
×
25

26

27
async def get_user_db(session: AsyncSession = Depends(get_async_session)):
1✔
28
    yield SQLAlchemyUserDatabase(session, User)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc