pytest: DX - Support targeting specific tests using make pytest
w/ PYTEST_TESTS
#7681
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a small PR intended to slightly improve developer experience. When running the Pytest integration testing suite locally using the command
make pytest
, the build system takes care of altering the local context variablePYTHONPATH
to make sure contributed modules are accessible to the process. While this works great for running the entire test suite, oftentimes developers are concerned with repeatedly running a subset of the tests, the particular test relevant to the functionality they are working on, or some problematic tests which the suite reports failing.Currently, in order to target specific tests for a
pytest
run, a developer might:make pytest
PYTHONPATH
PYTHONPATH
variablepytest
outside of theMakefile
context and feeding in the targeted list of files and tests cases to the local commandThis PR suggests supporting the pass-through of a variable named
PYTEST_TESTS
which defaults totests/
and can be set in a similar fashion toPYTEST_PAR
andPYTEST_OPTS
. This would allow developers to skip a few steps in setting up their local environment for runningpytest
and enjoy some of theMakefile
's sane defaults if desired. For example,Certainly, experienced CLN developers already have more convenient workflows, so please let me know if there is a more accessible convention for this.
Checklist
Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked: