Skip to content

Instantly share code, notes, and snippets.

View Upgwades's full-sized avatar

Will Irwin Upgwades

  • Florida
View GitHub Profile
@Upgwades
Upgwades / fixtures.py
Created February 15, 2023 23:19
Sqlalchemy pytest convenience fixtures
import pytest
from models import Base
from pytest_postgresql import factories
from sqlalchemy import create_engine, text
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy.pool import NullPool
from sqlalchemy_utils import database_exists, create_database
user = "postgres"