Skip to content

Commit 9cd8aed

Browse files
committed
Add a cross-reference to the docs
1 parent 10da4bb commit 9cd8aed

File tree

1 file changed

+7
-4
lines changed
  • hypothesis-python/src/hypothesis/strategies/_internal

1 file changed

+7
-4
lines changed

hypothesis-python/src/hypothesis/strategies/_internal/core.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,9 @@ def randoms(
779779
would occur with very low probability when it is set to True, and this
780780
flag should only be set to True when your code relies on the distribution
781781
of values for correctness.
782+
783+
For managing global state, see the :func:`~hypothesis.strategies.random_module`
784+
strategy and :func:`~hypothesis.register_random` function.
782785
"""
783786
check_type(bool, note_method_calls, "note_method_calls")
784787
check_type(bool, use_true_random, "use_true_random")
@@ -814,16 +817,16 @@ def do_draw(self, data):
814817
@cacheable
815818
@defines_strategy()
816819
def random_module() -> SearchStrategy[RandomSeeder]:
817-
"""The Hypothesis engine handles PRNG state for the stdlib and Numpy random
818-
modules internally, always seeding them to zero and restoring the previous
819-
state after the test.
820+
"""Hypothesis always seeds global PRNGs before running a test, and restores the
821+
previous state afterwards.
820822
821823
If having a fixed seed would unacceptably weaken your tests, and you
822824
cannot use a ``random.Random`` instance provided by
823825
:func:`~hypothesis.strategies.randoms`, this strategy calls
824826
:func:`python:random.seed` with an arbitrary integer and passes you
825827
an opaque object whose repr displays the seed value for debugging.
826-
If ``numpy.random`` is available, that state is also managed.
828+
If ``numpy.random`` is available, that state is also managed, as is anything
829+
managed by :func:`hypothesis.register_random`.
827830
828831
Examples from these strategy shrink to seeds closer to zero.
829832
"""

0 commit comments

Comments
 (0)