Skip to content

Commit

Permalink
fix api tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kgarbacinski committed May 16, 2024
1 parent 8cf2143 commit 95af7bb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions backend/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ def create_app(config=None):
template_folder=f"{config.PROJECT_ROOT}/templates",
static_folder=f"{config.PROJECT_ROOT}/static",
)
app.teardown_request(teardown_session)

app.teardown_request(teardown_session)(app)

app.config.from_object(config)

register_extensions(app)
Expand Down Expand Up @@ -60,5 +62,6 @@ def register_errorhandlers(app):
app.register_error_handler(Exception, handler)


def teardown_session(*args, **kwargs):
db.session.remove()
def teardown_session(app: Flask, *args, **kwargs):
with app.app_context():
db.session.remove()

0 comments on commit 95af7bb

Please sign in to comment.