Skip to content

Instantly share code, notes, and snippets.

View richddr's full-sized avatar
🇩🇴

Richard Garcia richddr

🇩🇴
View GitHub Profile
@gene1wood
gene1wood / clipboard-decrypt
Created September 23, 2014 21:35
command to decrypt GPG data from your clipboard and replace your clipboard with the decrypted contents
xsel | gpg --decrypt | xsel --clipboard
@inklesspen
inklesspen / README.md
Last active September 6, 2023 17:11
Fast and flexible unit tests with live Postgres databases and fixtures

(This gist is pretty old; I've written up my current approach to the Pyramid integration on this blog post, but that blog post doesn't go into the transactional management, so you may still find this useful.)

Fast and flexible unit tests with live Postgres databases and fixtures

I've created a Pyramid scaffold which integrates Alembic, a migration tool, with the standard SQLAlchemy scaffold. (It also configures the Mako template system, because I prefer Mako.)

I am also using PostgreSQL for my database. PostgreSQL supports nested transactions. This means I can setup the tables at the beginning of the test session, then start a transaction before each test happens and roll it back after the test; in turn, this means my tests operate in the same environment I expect to use in production, but they are also fast.

I based my approach on [sontek's blog post](http://sontek.net/blog/