It is difficult to create unit tests because SQLAlchemy maintain some objects in memory for performance reasons. I have to workaround this behaviour to write useful tests.