summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngelos Evripiotis <jevripiotis@bloomberg.net>2019-01-11 14:16:18 +0000
committerAngelos Evripiotis <jevripiotis@bloomberg.net>2019-01-11 15:30:39 +0000
commit3a760358edc8526274612a3b0496d39bce3016b8 (patch)
tree254c1c46dd45c1ba52c19004d34857e5c12210fe
parent7d3837ed30d1c3e1d43989ee745fbda4f1125103 (diff)
downloadbuildstream-aevri/tox_no_cov.tar.gz
contributing: '--last-failed' and '--no-cov' tipsaevri/tox_no_cov
To help new folks get to grips with pytest, add some tips on other frequently used features.
-rw-r--r--CONTRIBUTING.rst10
1 files changed, 10 insertions, 0 deletions
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index 595fc5389..a8a3a03a6 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -1534,6 +1534,10 @@ You can always abort on the first failure by running::
tox -- -x
+Similarly, you may also be interested in the ``--last-failed`` and
+``--failed-first`` options as per the
+`pytest cache <https://docs.pytest.org/en/latest/cache.html>`_ documentation.
+
If you want to run a specific test or a group of tests, you
can specify a prefix to match. E.g. if you want to run all of
the frontend tests you can do::
@@ -1545,6 +1549,12 @@ If you wanted to run the test_build_track test within frontend/buildtrack.py you
tox -- tests/frontend/buildtrack.py::test_build_track
+When running only a few tests, you may find the coverage and timing output
+excessive, there are options to trim them. Note that coverage step will fail.
+Here is an example::
+
+ tox -- --no-cov --durations=1 tests/frontend/buildtrack.py::test_build_track
+
We also have a set of slow integration tests that are disabled by
default - you will notice most of them marked with SKIP in the pytest
output. To run them, you can use::