From 356ec4cc0ca7741e955d914c1b2f10b399268c2c Mon Sep 17 00:00:00 2001 From: Se7enZ Date: Thu, 19 Sep 2024 13:16:38 +0200 Subject: [PATCH] pytest: Support targeting specific tests using `make pytest`. Select tests by setting the `PYTEST_TESTS` environment variable. Changelog-None --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4cdf97c9aca0..f835842c99ee 100644 --- a/Makefile +++ b/Makefile @@ -456,6 +456,11 @@ else PYTEST_OPTS += -x endif +# Allow for targeting specific tests by setting the PYTEST_TESTS environment variable. +ifeq ($(PYTEST_TESTS),) +PYTEST_TESTS = "tests/" +endif + check-units: check: check-units installcheck pytest @@ -466,7 +471,7 @@ ifeq ($(PYTEST),) exit 1 else # Explicitly hand VALGRIND so you can override on make cmd line. - PYTHONPATH=$(MY_CHECK_PYTHONPATH) TEST_DEBUG=1 VALGRIND=$(VALGRIND) $(PYTEST) tests/ $(PYTEST_OPTS) + PYTHONPATH=$(MY_CHECK_PYTHONPATH) TEST_DEBUG=1 VALGRIND=$(VALGRIND) $(PYTEST) $(PYTEST_TESTS) $(PYTEST_OPTS) endif check-fuzz: $(ALL_FUZZ_TARGETS)