API - fix database connections error on tests

This commit is contained in:
Sam 2019-08-28 12:31:40 +02:00
parent fe43b6f97e
commit 667e31d053

View File

@ -19,6 +19,10 @@ def app():
yield app yield app
db.session.remove() db.session.remove()
db.drop_all() db.drop_all()
# close unused idle connections => avoid the following error:
# FATAL: remaining connection slots are reserved for non-replication
# superuser connections
db.engine.dispose()
return app return app
@ -31,6 +35,7 @@ def app_no_registration():
yield app yield app
db.session.remove() db.session.remove()
db.drop_all() db.drop_all()
db.engine.dispose()
return app return app