make: Improve Python testing support #45
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "jan/feature/20260702-improve-python-testing-support"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add py-test.mk, a Makefile snippet designed to unify pytest directories, and fix missing test dependencies that were made obvious in the process.
make: Make target test depend on target all
Every directory should have a test target, and the test target should depend on all so that all files are generated that might be needed for testing. This commit fixes some missing targets, and adds some missing dependencies.
py-test.mk: Add file
Add a dedicated py-test.mk for running tests with pytest instead of python.
The commit introduces a new variable PYTHON_RUNNER, which is then used by py-run.mk to do it's usual thing. Running pytest is similar enough to running Python programs to keep the rest of the machinery and prevent redundancy from creeping in.
py-test.mk: Generate conftest.py
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.