File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -126,14 +126,26 @@ cmake --build build --target check
126126` --target ` can be spelled ` -t ` in CMake 3.15+. You can also run individual
127127tests with these targets:
128128
129- * ` pytest ` : Python tests only
129+ * ` pytest ` : Python tests only, using the
130+ [ pytest] ( https://docs.pytest.org/en/stable/ ) framework
130131* ` cpptest ` : C++ tests only
131132* ` test_cmake_build ` : Install / subdirectory tests
132133
133134If you want to build just a subset of tests, use
134135` -DPYBIND11_TEST_OVERRIDE="test_callbacks.cpp;test_pickling.cpp" ` . If this is
135136empty, all tests will be built.
136137
138+ You may also pass flags to the ` pytest ` target by editing ` tests/pytest.ini ` or
139+ by using the ` PYTEST_ADDOPTS ` environment variable
140+ (see [ ` pytest ` docs] ( https://docs.pytest.org/en/2.7.3/customize.html#adding-default-options ) ). As an example:
141+
142+ ``` bash
143+ env PYTEST_ADDOPTS=" --capture=no --exitfirst" \
144+ cmake --build build --target pytest
145+ # Or using abbreviated flags
146+ env PYTEST_ADDOPTS=" -s -x" cmake --build build --target pytest
147+ ```
148+
137149### Formatting
138150
139151All formatting is handled by pre-commit.
You can’t perform that action at this time.
0 commit comments