diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2017-09-26 22:31:59 +0200 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2017-09-26 22:31:59 +0200 |
commit | 41aa302727b80d2c9d745f4534ed7cb4ce031a95 (patch) | |
tree | 05dd16df1809c73db4f6c753f8aca66de7e19b59 /doc | |
parent | ef35406c09e19792d57cc3121cdcd4c43afa6f46 (diff) | |
parent | 1e066db4b8d900418520cc06d29361fbf9126345 (diff) | |
download | nixlib-41aa302727b80d2c9d745f4534ed7cb4ce031a95.tar nixlib-41aa302727b80d2c9d745f4534ed7cb4ce031a95.tar.gz nixlib-41aa302727b80d2c9d745f4534ed7cb4ce031a95.tar.bz2 nixlib-41aa302727b80d2c9d745f4534ed7cb4ce031a95.tar.lz nixlib-41aa302727b80d2c9d745f4534ed7cb4ce031a95.tar.xz nixlib-41aa302727b80d2c9d745f4534ed7cb4ce031a95.tar.zst nixlib-41aa302727b80d2c9d745f4534ed7cb4ce031a95.zip |
Merge branch 'master' into staging
Diffstat (limited to 'doc')
-rw-r--r-- | doc/languages-frameworks/python.md | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/doc/languages-frameworks/python.md b/doc/languages-frameworks/python.md index 298da8f9f0d2..7bdbbbd903a0 100644 --- a/doc/languages-frameworks/python.md +++ b/doc/languages-frameworks/python.md @@ -785,7 +785,20 @@ example of such a situation is when `py.test` is used. #### Common issues -- Non-working tests can often be deselected. In the case of `py.test`: `py.test -k 'not function_name and not other_function'`. +- Non-working tests can often be deselected. By default `buildPythonPackage` runs `python setup.py test`. + Most python modules follows the standard test protocol where the pytest runner can be used instead. + `py.test` supports a `-k` parameter to ignore test methods or classes: + + ```nix + buildPythonPackage { + # ... + # assumes the tests are located in tests + checkInputs = [ pytest ]; + checkPhase = '' + py.test -k 'not function_name and not other_function' tests + ''; + } + ``` - Unicode issues can typically be fixed by including `glibcLocales` in `buildInputs` and exporting `LC_ALL=en_US.utf-8`. - Tests that attempt to access `$HOME` can be fixed by using the following work-around before running tests (e.g. `preCheck`): `export HOME=$(mktemp -d)` |