From b67b15f7b0a4b07ea59c1a07d1961d6afc2f3b50 Mon Sep 17 00:00:00 2001 From: Morgan Courbet Date: Thu, 6 Jul 2017 19:11:38 +0200 Subject: [PATCH] Update tests/README.md to add specific test run --- tests/README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/README.md b/tests/README.md index e2d4039..2079cfc 100644 --- a/tests/README.md +++ b/tests/README.md @@ -13,6 +13,8 @@ $ sudo apt install pypy python2.7 python3.5 python3.6 python-tox Running the tests ----------------- +### Running the complete test suite + ```shell-session $ make test ``` @@ -22,3 +24,23 @@ If the tests failed whereas [the ones from the last tag](https://travis-ci.org/p ```shell-session $ env HOME=/tmp make test ``` + +### Running only a specific test + +If you are developing a new hook or adding features to an existing one, you may want to run the tests for that particular hook. The following command will run the wanted test on every supported Python version. + +```shell-session +$ tox tests/.py +``` + +If you want to run your test for a specific Python version (for a quicker execution), you can specify it with the `-e` option of `tox`. At the moment, the supported Python versions are `2.7` (`-e py27`), `3.4` (`-e py34`), and `3.5` (`-e py35`). For example: + +```shell-session +$ tox -e py27 tests/.py +``` + +You can run your specific test ignoring your own Git configuration like so: + +```shell-session +$ env HOME=/tmp tox -e py27 tests/.py +```