API - add files cleanup step on tests
This commit is contained in:
parent
834ed40df4
commit
e6e43e181a
7
fittrackee/tests/fixtures/fixtures_app.py
vendored
7
fittrackee/tests/fixtures/fixtures_app.py
vendored
@ -1,7 +1,9 @@
|
|||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
from typing import Generator, Optional, Union
|
from typing import Generator, Optional, Union
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
from flask import current_app
|
||||||
|
|
||||||
from fittrackee import create_app, db
|
from fittrackee import create_app, db
|
||||||
from fittrackee.application.models import AppConfig
|
from fittrackee.application.models import AppConfig
|
||||||
@ -65,6 +67,11 @@ def get_app(
|
|||||||
# FATAL: remaining connection slots are reserved for
|
# FATAL: remaining connection slots are reserved for
|
||||||
# non-replication superuser connections
|
# non-replication superuser connections
|
||||||
db.engine.dispose()
|
db.engine.dispose()
|
||||||
|
# remove all temp files like gpx files
|
||||||
|
shutil.rmtree(
|
||||||
|
current_app.config['UPLOAD_FOLDER'],
|
||||||
|
ignore_errors=True,
|
||||||
|
)
|
||||||
return app
|
return app
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user