Only run full procfile on runserver

This commit is contained in:
2025-03-04 11:59:35 +01:00
parent 728ad157e9
commit 75c4c55a32
9 changed files with 19 additions and 17 deletions

View File

@ -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)

View File

@ -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")