Skip to content

Commit

Permalink
pytest: Support targeting specific tests using make pytest.
Browse files Browse the repository at this point in the history
Select tests by setting the `PYTEST_TESTS` environment variable.

Changelog-None
  • Loading branch information
s373nZ committed Sep 19, 2024
1 parent 0aa52b7 commit 356ec4c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 356ec4c

Please sign in to comment.