File tree 1 file changed +13
-1
lines changed 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
126
126
` --target ` can be spelled ` -t ` in CMake 3.15+. You can also run individual
127
127
tests with these targets:
128
128
129
- * ` pytest ` : Python tests only
129
+ * ` pytest ` : Python tests only, using the
130
+ [ pytest] ( https://docs.pytest.org/en/stable/ ) framework
130
131
* ` cpptest ` : C++ tests only
131
132
* ` test_cmake_build ` : Install / subdirectory tests
132
133
133
134
If you want to build just a subset of tests, use
134
135
` -DPYBIND11_TEST_OVERRIDE="test_callbacks.cpp;test_pickling.cpp" ` . If this is
135
136
empty, all tests will be built.
136
137
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
+
137
149
### Formatting
138
150
139
151
All formatting is handled by pre-commit.
You can’t perform that action at this time.
0 commit comments