diff options
| author | Mads Jensen <mje@inducks.org> | 2019-12-22 11:23:46 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-12-30 11:25:18 +0100 |
| commit | ea44d86ed43349db25b6b2d8e4d4af2d5c618cf9 (patch) | |
| tree | 8e074d5ef25009128921f069754d9e9ba4defdfe /docs/internals/contributing/writing-code/coding-style.txt | |
| parent | 9e14bc2135cb806b66374bac791c79344fff4ded (diff) | |
Added guidelines for assertIs() usage.
Diffstat (limited to 'docs/internals/contributing/writing-code/coding-style.txt')
| -rw-r--r-- | docs/internals/contributing/writing-code/coding-style.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/internals/contributing/writing-code/coding-style.txt b/docs/internals/contributing/writing-code/coding-style.txt index f9952b3661..43db31501e 100644 --- a/docs/internals/contributing/writing-code/coding-style.txt +++ b/docs/internals/contributing/writing-code/coding-style.txt @@ -71,6 +71,11 @@ Python style and :meth:`~unittest.TestCase.assertWarnsRegex` only if you need regular expression matching. + Use :meth:`assertIs(…, True/False)<unittest.TestCase.assertIs>` for testing + boolean values, rather than :meth:`~unittest.TestCase.assertTrue` and + :meth:`~unittest.TestCase.assertFalse`, so you can check the actual boolean + value, not the truthiness of the expression. + * In test docstrings, state the expected behavior that each test demonstrates. Don't include preambles such as "Tests that" or "Ensures that". |
