make: Improve Python testing support #45

Merged
Jan Lindemann merged 3 commits from jan/feature/20260702-improve-python-testing-support into master 2026-07-02 20:01:44 +02:00 AGit

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.

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.

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.

Signed-off-by: Jan Lindemann <jan@janware.com>

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.

Signed-off-by: Jan Lindemann <jan@janware.com>
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
0c92d942ec

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>
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-07-02 19:52:40 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
janware/jw-pkg!45
No description provided.