Skip to content

Instantly share code, notes, and snippets.

View mahmad-nutrien's full-sized avatar

Mohammad Ahmad mahmad-nutrien

View GitHub Profile
@mahmad-nutrien
mahmad-nutrien / keybase.md
Created June 26, 2019 15:10
Keybase Verification

Keybase proof

I hereby claim:

  • I am mahmad-nutrien on github.
  • I am mahmad_nutrien (https://keybase.io/mahmad_nutrien) on keybase.
  • I have a public key ASD-FU16eClMm0X9I_e4qxRMi9GAHqDh6tCKqoDLL7Gadgo

To claim this, I am signing this object:

@mahmad-nutrien
mahmad-nutrien / gist:a372671f76c162ec9aa2e083f5bab2ca
Created June 10, 2019 17:22 — forked from zzzeek/gist:8443477
expands upon the SQLAlchemy "test rollback fixure" at http://docs.sqlalchemy.org/en/rel_0_9/orm/session.html#joining-a-session-into-an-external-transaction to also support tests that have any combination of ROLLBACK/COMMIT within them, by ensuring that the Session always runs transactions inside of a savepoint.
from sqlalchemy import Column, Integer, create_engine
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
# a model
class Thing(Base):
__tablename__ = 'thing'
id = Column(Integer, primary_key=True)