Skip to content

Commit 356ec4c

Browse files
committed
pytest: Support targeting specific tests using make pytest.
Select tests by setting the `PYTEST_TESTS` environment variable. Changelog-None
1 parent 0aa52b7 commit 356ec4c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,11 @@ else
456456
PYTEST_OPTS += -x
457457
endif
458458

459+
# Allow for targeting specific tests by setting the PYTEST_TESTS environment variable.
460+
ifeq ($(PYTEST_TESTS),)
461+
PYTEST_TESTS = "tests/"
462+
endif
463+
459464
check-units:
460465

461466
check: check-units installcheck pytest
@@ -466,7 +471,7 @@ ifeq ($(PYTEST),)
466471
exit 1
467472
else
468473
# Explicitly hand VALGRIND so you can override on make cmd line.
469-
PYTHONPATH=$(MY_CHECK_PYTHONPATH) TEST_DEBUG=1 VALGRIND=$(VALGRIND) $(PYTEST) tests/ $(PYTEST_OPTS)
474+
PYTHONPATH=$(MY_CHECK_PYTHONPATH) TEST_DEBUG=1 VALGRIND=$(VALGRIND) $(PYTEST) $(PYTEST_TESTS) $(PYTEST_OPTS)
470475
endif
471476

472477
check-fuzz: $(ALL_FUZZ_TARGETS)

0 commit comments

Comments
 (0)