From 912f7d9e01e77b45911915166965c780ff16d553 Mon Sep 17 00:00:00 2001 From: Morgan Courbet Date: Sun, 11 Jun 2017 21:05:34 +0200 Subject: [PATCH 1/6] Add test instructions --- tests/README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/README.md diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 0000000..e9eafca --- /dev/null +++ b/tests/README.md @@ -0,0 +1,18 @@ +Testing +======= + +Installing the test environment +------------------------------- + +### Debian-based distributions + +```shell-session +$ sudo apt install pypy python-tox +``` + +Running the tests +----------------- + +```shell-session +$ make test +``` From 7b39fa13a6dafc74a8b3f64b63779f6a20f60bdb Mon Sep 17 00:00:00 2001 From: Morgan Courbet Date: Wed, 5 Jul 2017 21:27:38 +0200 Subject: [PATCH 2/6] Update tests/README.md --- tests/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/README.md b/tests/README.md index e9eafca..36a5803 100644 --- a/tests/README.md +++ b/tests/README.md @@ -16,3 +16,9 @@ Running the tests ```shell-session $ make test ``` + +If the tests failed whereas [the ones from the last tag](https://travis-ci.org/pre-commit/pre-commit-hooks) did not, your Git configuration might interfere with `pre-commit-hooks`. In this case, you can ignore your current Git configuration by setting a temporary environment variable: + +```shell-session +$ env HOME=/tmp make test +``` From 9bca0b4897160d618ad080cb635738eaac21e31f Mon Sep 17 00:00:00 2001 From: Morgan Courbet Date: Wed, 5 Jul 2017 21:41:07 +0200 Subject: [PATCH 3/6] Update tests/README.md to add multiple Python versions --- tests/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/README.md b/tests/README.md index 36a5803..e2d4039 100644 --- a/tests/README.md +++ b/tests/README.md @@ -7,7 +7,7 @@ Installing the test environment ### Debian-based distributions ```shell-session -$ sudo apt install pypy python-tox +$ sudo apt install pypy python2.7 python3.5 python3.6 python-tox ``` Running the tests From b67b15f7b0a4b07ea59c1a07d1961d6afc2f3b50 Mon Sep 17 00:00:00 2001 From: Morgan Courbet Date: Thu, 6 Jul 2017 19:11:38 +0200 Subject: [PATCH 4/6] 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 +``` From 2c042fda2ae78db9e6d0d516cf9a2dd6b6615210 Mon Sep 17 00:00:00 2001 From: Morgan Courbet Date: Mon, 17 Jul 2017 19:05:59 +0200 Subject: [PATCH 5/6] Update tests/README.md --- tests/README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/README.md b/tests/README.md index 2079cfc..609b8a9 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,10 +1,16 @@ Testing ======= +The test will run with the following environments: +- Python version 2.7 +- Python version 3.5 +- Python version 3.6 +- PyPy + Installing the test environment ------------------------------- -### Debian-based distributions +### Debian-based distributions (Ubuntu, Mint, etc.) ```shell-session $ sudo apt install pypy python2.7 python3.5 python3.6 python-tox From 66a8778df58333e2998c17adc29121a1af618ba6 Mon Sep 17 00:00:00 2001 From: Morgan Courbet Date: Mon, 17 Jul 2017 21:19:35 +0200 Subject: [PATCH 6/6] Update supported Python versions in tests/README.md --- tests/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/README.md b/tests/README.md index 609b8a9..7c94052 100644 --- a/tests/README.md +++ b/tests/README.md @@ -39,7 +39,7 @@ If you are developing a new hook or adding features to an existing one, you may $ 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: +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.5` (`-e py35`), and `3.6` (`-e py36`). For example: ```shell-session $ tox -e py27 tests/.py