Skip to content

Commit 1416fe1

Browse files
committed
Fix assume condition in adapting-strategies.rst
The `adapting-strategies.rst` doc states that the `assume(condition)` function skips test cases where `condition` is `True`, but this appears to be the opposite of the actual behavior. See for example `hypothesis/src/hypothesis.control.py` lines 80-81 where `if not condition` raises an exception. Additionally the code example in `adapting-strategies.rst` states that "b will be nonzero here" after calling `assume(b != 0)`, which suggests the test case will be skipped where condition is `False`. This PR fixes the error by replacing `True` with `False`.
1 parent 4afeada commit 1416fe1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

hypothesis/docs/tutorial/adapting-strategies.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Assuming away test cases
5656

5757
|.filter| lets you filter test inputs from a single strategy. Hypothesis also provides an |assume| function for when you need to filter an entire test case, based on an arbitrary condition.
5858

59-
The |assume| function skips test cases where some condition evaluates to ``True``. You can use it anywhere in your test. We could have expressed our |.filter| example above using |assume| as well:
59+
The |assume| function skips test cases where some condition evaluates to ``False``. You can use it anywhere in your test. We could have expressed our |.filter| example above using |assume| as well:
6060

6161
.. code-block:: python
6262

0 commit comments

Comments
 (0)