Browse Source

CONTRIBUTING: Add suggestion about passing pytest flags (#2738)

reviewable/pr2746/r1
Eric Cousineau 5 years ago committed by GitHub
parent
commit
635e3fc92f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      .github/CONTRIBUTING.md

14
.github/CONTRIBUTING.md

@ -126,7 +126,8 @@ cmake --build build --target check @@ -126,7 +126,8 @@ cmake --build build --target check
`--target` can be spelled `-t` in CMake 3.15+. You can also run individual
tests with these targets:
* `pytest`: Python tests only
* `pytest`: Python tests only, using the
[pytest](https://docs.pytest.org/en/stable/) framework
* `cpptest`: C++ tests only
* `test_cmake_build`: Install / subdirectory tests
@ -134,6 +135,17 @@ If you want to build just a subset of tests, use @@ -134,6 +135,17 @@ If you want to build just a subset of tests, use
`-DPYBIND11_TEST_OVERRIDE="test_callbacks.cpp;test_pickling.cpp"`. If this is
empty, all tests will be built.
You may also pass flags to the `pytest` target by editing `tests/pytest.ini` or
by using the `PYTEST_ADDOPTS` environment variable
(see [`pytest` docs](https://docs.pytest.org/en/2.7.3/customize.html#adding-default-options)). As an example:
```bash
env PYTEST_ADDOPTS="--capture=no --exitfirst" \
cmake --build build --target pytest
# Or using abbreviated flags
env PYTEST_ADDOPTS="-s -x" cmake --build build --target pytest
```
### Formatting
All formatting is handled by pre-commit.

Loading…
Cancel
Save