Skip to content

Commit

Permalink
docs/python: more infos regarding failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 committed Sep 25, 2017
1 parent ffd6cbe commit 9d9a28f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion doc/languages-frameworks/python.md
Expand Up @@ -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)`

Expand Down

1 comment on commit 9d9a28f

@Mic92
Copy link
Member Author

@Mic92 Mic92 commented on 9d9a28f Sep 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FRidh I was a bit surprised that editing via github, directly leads to commits to master as a member.
Nevertheless I hope this clarify things a bit more.

Please sign in to comment.