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 variable PYTHONPATH 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:
Run make pytest
Observe the output to discern and capture the computed value for PYTHONPATH
Copy this value
Export the value as a local PYTHONPATH variable
Run pytest outside of the Makefile context and feeding in the targeted list of files and tests cases to the local command
This PR suggests supporting the pass-through of a variable named PYTEST_TESTS which defaults to tests/ and can be set in a similar fashion to PYTEST_PAR and PYTEST_OPTS. This would allow developers to skip a few steps in setting up their local environment for running pytest and enjoy some of the Makefile's sane defaults if desired. For example,
PYTEST_TESTS="tests/test_askrene.py::test_layers" make pytest
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:
[x] The changelog has been updated in the relevant commit(s) according to the guidelines.
[ ] Tests have been added or modified to reflect the changes.
[ ] Documentation has been reviewed and updated as needed.
[ ] Related issues have been listed and linked, including any that this PR closes.
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: