Use py.test test runner.

This commit is contained in:
Bastian Kleineidam 2012-09-26 14:42:11 +02:00
parent 58c4cffcc8
commit ef9d5e86e9

View file

@ -6,17 +6,17 @@ ARCHIVE:=dosage-$(VERSION).tar.gz
PY_FILES_DIRS := dosage dosagelib tests *.py PY_FILES_DIRS := dosage dosagelib tests *.py
PY2APPOPTS ?= PY2APPOPTS ?=
NUMPROCESSORS:=$(shell grep -c processor /proc/cpuinfo) NUMPROCESSORS:=$(shell grep -c processor /proc/cpuinfo)
NOSETESTS:=$(shell which nosetests) MAXFAILEDTESTS:=200
# Nose options: # Pytest options:
# - do not show output of successful tests # - stop after MAXFAILEDTESTS failed errors
# - use multiple processors # - use multiple processors
# - be verbose # - write test results in file
# - only run test_* methods # - run all tests found in the "tests" subdirectory
NOSEOPTS:=--logging-clear-handlers --processes=$(NUMPROCESSORS) -v -m '^test_.*' PYTESTOPTS:=--maxfail=$(MAXFAILEDTESTS) -n $(NUMPROCESSORS) --resultlog=testresults.txt
CHMODMINUSMINUS:=-- CHMODMINUSMINUS:=--
# which test modules to run # directory or file with tests to run
TESTS ?= tests/ TESTS ?= tests
# set test options, eg. to "--nologcapture" # set test options, eg. to "--verbose"
TESTOPTS= TESTOPTS=
all: all:
@ -67,8 +67,7 @@ check:
doccheck: doccheck:
py-check-docstrings --force \ py-check-docstrings --force \
dosagelib/*.py \ dosagelib \
dosagelib/plugins/*.py \
dosage \ dosage \
*.py *.py
@ -93,12 +92,13 @@ distclean: clean
.PHONY: test .PHONY: test
test: test:
$(PYTHON) $(NOSETESTS) $(NOSEOPTS) $(TESTOPTS) $(TESTS) $(PYTHON) -m pytest $(PYTESTOPTS) $(TESTOPTS) $(TESTS)
.PHONY: deb .PHONY: deb
deb: deb:
git-buildpackage --git-export-dir=../build-area/ --git-upstream-branch=master --git-debian-branch=debian --git-ignore-new git-buildpackage --git-export-dir=../build-area/ --git-upstream-branch=master --git-debian-branch=debian --git-ignore-new
.PHONY: comics
comics: comics:
./dosage -v @@ > comics.log 2>&1 ./dosage -v @@ > comics.log 2>&1