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 13:04:07 +0100 |
| commit | 222b56474dd99a460d37ccffa79a71ecec5e28fb (patch) | |
| tree | 63147f78059625b6ba51972a124bdc4f81716819 /docs/internals/contributing/writing-code/coding-style.txt | |
| parent | a04e6fb3557de79826d946c34bde6d049fd45c55 (diff) | |
[3.0.x] Added guidelines for assertIs() usage.
Backport of ea44d86ed43349db25b6b2d8e4d4af2d5c618cf9 from master
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". |
