Skip to content

Instantly share code, notes, and snippets.

View richard-savant's full-sized avatar
🏠
Working from home

richard-savant

🏠
Working from home
View GitHub Profile
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
@richard-savant
richard-savant / marshmallow_operation_field.py
Last active July 2, 2020 16:22
Marshmallow with custom operation for a field
from src import models
from werkzeug import security
from marshmallow.fields import Field
from marshmallow import post_load, fields
import json
class Author(models.db.Model):
@richard-savant
richard-savant / pytest_flask_fixtures.py
Created March 27, 2020 20:36 — forked from qodot/pytest_flask_fixtures.py
Pytest Fixtures (Flask, SQLAlchemy, Alembic)
import sys
import pytest
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from alembic.command import upgrade as alembic_upgrade
from alembic.config import Config as AlembicConfig
from wsgi import create_app
from config import config