When running a celery task, in a SQLAlchemy event, in a unit-test the connection get destroyed somehow.
I attached the requirement to reproduce the bug:
git clone https://gist.github.com/5762792fc1d628843697.git cd 5762792fc1d628843697 virtualenv venv . venv/bin/activate pip install -r requirements.txt python test.py
There is a bounty open for this bug on stack overflow