From ef9d5e86e9cb1067667a363e68e52b7a031ebcd3 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Wed, 26 Sep 2012 14:42:11 +0200 Subject: [PATCH] Use py.test test runner. --- Makefile | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index b462bc1f4..f8aee6188 100644 --- a/Makefile +++ b/Makefile @@ -6,17 +6,17 @@ ARCHIVE:=dosage-$(VERSION).tar.gz PY_FILES_DIRS := dosage dosagelib tests *.py PY2APPOPTS ?= NUMPROCESSORS:=$(shell grep -c processor /proc/cpuinfo) -NOSETESTS:=$(shell which nosetests) -# Nose options: -# - do not show output of successful tests +MAXFAILEDTESTS:=200 +# Pytest options: +# - stop after MAXFAILEDTESTS failed errors # - use multiple processors -# - be verbose -# - only run test_* methods -NOSEOPTS:=--logging-clear-handlers --processes=$(NUMPROCESSORS) -v -m '^test_.*' +# - write test results in file +# - run all tests found in the "tests" subdirectory +PYTESTOPTS:=--maxfail=$(MAXFAILEDTESTS) -n $(NUMPROCESSORS) --resultlog=testresults.txt CHMODMINUSMINUS:=-- -# which test modules to run -TESTS ?= tests/ -# set test options, eg. to "--nologcapture" +# directory or file with tests to run +TESTS ?= tests +# set test options, eg. to "--verbose" TESTOPTS= all: @@ -67,8 +67,7 @@ check: doccheck: py-check-docstrings --force \ - dosagelib/*.py \ - dosagelib/plugins/*.py \ + dosagelib \ dosage \ *.py @@ -93,12 +92,13 @@ distclean: clean .PHONY: test test: - $(PYTHON) $(NOSETESTS) $(NOSEOPTS) $(TESTOPTS) $(TESTS) + $(PYTHON) -m pytest $(PYTESTOPTS) $(TESTOPTS) $(TESTS) .PHONY: deb deb: git-buildpackage --git-export-dir=../build-area/ --git-upstream-branch=master --git-debian-branch=debian --git-ignore-new +.PHONY: comics comics: ./dosage -v @@ > comics.log 2>&1