Skip to content

Instantly share code, notes, and snippets.

@ghl3
Created November 29, 2012 14:26
Show Gist options
  • Save ghl3/4169432 to your computer and use it in GitHub Desktop.
Save ghl3/4169432 to your computer and use it in GitHub Desktop.
Makefile for python unittest
RUNTEST=python -m unittest -v -b
ALLMODULES=$(patsubst %.py, %, $(wildcard test_*.py))
all:
${RUNTEST} ${ALLMODULES}
% : test_%.py
${RUNTEST} test_$@
@mjkrause
Copy link

mjkrause commented May 8, 2018

Thanks for posting. Small correction:
ALLMODULES=$(patsubst %.py, %.py, $(wildcard test_*.py))
(otherwise your list of test Python test files have no extension and the no test is executed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment