Creating AutoAwaitTestClient for tests which automatically runs background tasks and expires db objects.
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Controller Tests / controller-tests (push) Waiting to run
Jest Tests / jest-tests (push) Waiting to run

This commit is contained in:
Roland 2026-01-05 16:48:21 -07:00
parent d5aa781397
commit 2a27d354a5
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
15 changed files with 97 additions and 150 deletions

View file

@ -10,7 +10,7 @@ from wrolpi import flags
from wrolpi.api_utils import json_response
from wrolpi.common import wrol_mode_check, get_media_directory, background_task
from wrolpi.errors import ValidationError
from wrolpi.vars import PYTEST, DOCKERIZED
from wrolpi.vars import DOCKERIZED
map_bp = Blueprint('Map', '/api/map')
@ -30,11 +30,7 @@ async def import_pbfs(_: Request, body: schema.ImportPost):
if not paths:
raise ValidationError('No PBF or dump files were provided')
coro = lib.import_files(paths)
if PYTEST:
await coro
else:
background_task(coro)
background_task(lib.import_files(paths))
return response.empty()