Mikko Kortelainen

Tag: Python

Methods for Both Classes and Instances in Python

I came across a situation where it would be nice for a Python class to have a method which works for both the class and its instances, and when called in an instance context, to know on which instance it was invoked. Python does not support this directly, but as …

read more

Flask-SQLAlchemy and PostgreSQL Unit Testing with Transaction Savepoints

PostgreSQL provides us two very powerful features which are helpful with unit testing: transactional DDL and transaction savepoints. In this article I will show you how to use those with Flask-SQLAlchemy unit tests.

Transactional DDL means you can create tables inside a transaction, run tests against them, and roll back …

read more
Page 1 of 2 >>