API - fix database connections error on tests
This commit is contained in:
parent
fe43b6f97e
commit
667e31d053
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user