misc: improve use of spooler (#76419) #70

Open
bdauvergne wants to merge 2 commits from wip/76419-utiliser-hobo-multitenant-uwsgid into main

2 Commits

Author SHA1 Message Date
Benjamin Dauvergne 78708d456a tox.ini: add runuwsgi target (#76419)
gitea/chrono/pipeline/head This commit looks good Details
2023-04-11 11:42:41 +02:00
Benjamin Dauvergne 3ea108a3fc misc: use hobo.multitenant.spooler (#76419)
Trying to import uwsgi should not be used to detect if we are running in
pytest or not, in order to run callbacks attached to on_commit event in
the context of pytest-django (which run all tests inside implicit
transactions).

Here we replace somme spooler functions by a simpler launch_to_spooler() which
can launch inside the spooler any picklable functions.

For running on_commit() callbacks, the django.db.transaction module is
mirrored inside chrono.utils.transaction and we monkeypatch it during
tests to immediately run any defined on_commit callback.
2023-04-11 11:42:24 +02:00