Debian Codegraph @

hypothesis-python/tests/nocover/test_limits.py

raw
1 # This file is part of Hypothesis, which may be found at
2 # https://github.com/HypothesisWorks/hypothesis/
3 #
4 # Copyright the Hypothesis Authors.
5 # Individual contributors are listed in AUTHORS.rst and the git log.
6 #
7 # This Source Code Form is subject to the terms of the Mozilla Public License,
8 # v. 2.0. If a copy of the MPL was not distributed with this file, You can
9 # obtain one at https://mozilla.org/MPL/2.0/.
10
11 from hypothesis import given, settings, strategies as st
12
13 from tests.common.utils import Why, xfail_on_crosshair
14
15
16 @xfail_on_crosshair(Why.other, strict=False) # might run fewer
17 def test_max_examples_are_respected():
18 counter = 0
19
20 @given(st.random_module(), st.integers())
21 @settings(max_examples=100)
22 def test(rnd, i):
23 nonlocal counter
24 counter += 1
25
26 test()
27 assert counter == 100