summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMads Jensen <mje@inducks.org>2019-12-22 11:23:46 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-12-30 13:04:07 +0100
commit222b56474dd99a460d37ccffa79a71ecec5e28fb (patch)
tree63147f78059625b6ba51972a124bdc4f81716819
parenta04e6fb3557de79826d946c34bde6d049fd45c55 (diff)
[3.0.x] Added guidelines for assertIs() usage.
Backport of ea44d86ed43349db25b6b2d8e4d4af2d5c618cf9 from master
-rw-r--r--docs/internals/contributing/writing-code/coding-style.txt5
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".