Skip to content

Instantly share code, notes, and snippets.

@viniciusao
Created June 24, 2022 16:09
Show Gist options
  • Save viniciusao/5e8d95288dde167184dbe73ef630775e to your computer and use it in GitHub Desktop.
Save viniciusao/5e8d95288dde167184dbe73ef630775e to your computer and use it in GitHub Desktop.
Pytest mock database: Tabelas
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class User(Base):
__tablename__ = "user"
__table_args__ = {"schema": "names"}
id = Column(Integer, primary_key=True, autoincrement=True)
name = Column(String)
class Actor(Base):
__tablename__ = "actor"
__table_args__ = {"schema": "names"}
id = Column(Integer, primary_key=True, autoincrement=True)
name = Column(String)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment