mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-05 06:04:21 +01:00
pytest: Use the py.test utility if available
The py.test unit test runner offers a number of more advanced features than simply running using unittest.main. In particular it allows us to capture a tests output and print it if it fails. This change checks whether we have pytest available and if yes, enables verbose tests and runs using pytest. This'll give the usual experience (with colors!) and show us the stdout if a test fails making travis a lot easier to handle. Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
committed by
Rusty Russell
parent
5320cab2de
commit
fc176b6cc0
6
Makefile
6
Makefile
@@ -29,6 +29,8 @@ ifeq ($(COVERAGE),1)
|
||||
COVFLAGS = --coverage
|
||||
endif
|
||||
|
||||
PYTEST := $(shell command -v pytest 2> /dev/null)
|
||||
|
||||
# This is where we add new features as bitcoin adds them.
|
||||
FEATURES :=
|
||||
|
||||
@@ -170,7 +172,11 @@ check:
|
||||
$(MAKE) pytest
|
||||
|
||||
pytest: $(ALL_PROGRAMS)
|
||||
ifndef PYTEST
|
||||
PYTHONPATH=contrib/pylightning DEVELOPER=$(DEVELOPER) python3 tests/test_lightningd.py -f
|
||||
else
|
||||
PYTHONPATH=contrib/pylightning TEST_DEBUG=1 DEVELOPER=$(DEVELOPER) $(PYTEST) -vx tests/test_lightningd.py
|
||||
endif
|
||||
|
||||
# Keep includes in alpha order.
|
||||
check-src-include-order/%: %
|
||||
|
||||
Reference in New Issue
Block a user