py-test.mk: Generate conftest.py
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 4m21s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m40s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 4m6s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m12s
CI / Packaging test (push) Successful in 0s

Generate a standard conftest.py, mostly for customizing pytest's bombastic test header, which otherwise lets the more informative make output look too pale in comparison.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-07-02 17:20:08 +02:00
commit 0c92d942ec
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61
2 changed files with 51 additions and 1 deletions

View file

@ -1,6 +1,23 @@
PYTHON_RUNNER ?= pytest -v
PY_CONFTEST ?= conftest.py
PY_UPDATE_PY_CONFTEST ?= true
ifeq ($(PY_UPDATE_PY_CONFTEST),true)
PY_GENERATED += $(PY_CONFTEST)
endif
PY_CONFTEST_CMD ?= /bin/bash $(JWB_SCRIPT_DIR)/python-tools.sh create-conftest-py
PY_TEST_ARGS ?= -v
PYTHON_RUNNER := pytest $(PY_TEST_ARGS)
include $(JWBDIR)/make/py-run.mk
all:
test: run
run: $(PY_GENERATED)
$(PY_CONFTEST):
$(PY_CONFTEST_CMD) > $@.tmp
mv $@.tmp $@
clean: clean.generated
clean.generated:
rm -f $(PY_GENERATED)