mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
Only run full procfile on runserver
This commit is contained in:
@ -3,7 +3,7 @@ import atexit
|
||||
import pytest
|
||||
|
||||
from .composer import start_composer, stop_composer
|
||||
from .settings import PROCFILE_PYTEST
|
||||
from .settings import PROCFILE_MINIMAL
|
||||
|
||||
# it's the first hook loaded by pytest and can only
|
||||
# be defined in a proper pytest plugin
|
||||
@ -15,6 +15,6 @@ from .settings import PROCFILE_PYTEST
|
||||
@pytest.hookimpl(tryfirst=True)
|
||||
def pytest_load_initial_conftests(early_config, parser, args):
|
||||
"""Hook that loads the composer before the pytest-django plugin"""
|
||||
if PROCFILE_PYTEST is not None:
|
||||
start_composer(PROCFILE_PYTEST)
|
||||
if PROCFILE_MINIMAL is not None:
|
||||
start_composer(PROCFILE_MINIMAL)
|
||||
_ = atexit.register(stop_composer)
|
||||
|
@ -64,8 +64,8 @@ def optional_file_parser(value: str) -> Path | None:
|
||||
BASE_DIR = Path(__file__).parent.parent.resolve()
|
||||
|
||||
# Composer settings
|
||||
PROCFILE_RUNSERVER = env.optional_file("PROCFILE_RUNSERVER", None)
|
||||
PROCFILE_PYTEST = env.optional_file("PROCFILE_PYTEST", None)
|
||||
PROCFILE_FULL = env.optional_file("PROCFILE_FULL", None)
|
||||
PROCFILE_MINIMAL = env.optional_file("PROCFILE_MINIMAL", None)
|
||||
|
||||
## File path used to avoid running the composer multiple times at the same time
|
||||
COMPOSER_PID_PATH = env.path("COMPOSER_PID_PATH", BASE_DIR / "composer.pid")
|
||||
|
Reference in New Issue
Block a user