From 5cc0acdef88b49924f69e081b60268eab28fb7ec Mon Sep 17 00:00:00 2001 From: Zac-HD Date: Wed, 18 Oct 2017 18:28:03 +1100 Subject: [PATCH] fixup annotate searchstrategy --- src/hypothesis/searchstrategy/lazy.py | 2 +- src/hypothesis/searchstrategy/strategies.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hypothesis/searchstrategy/lazy.py b/src/hypothesis/searchstrategy/lazy.py index b1ba6c36b1c..b62965ab7df 100644 --- a/src/hypothesis/searchstrategy/lazy.py +++ b/src/hypothesis/searchstrategy/lazy.py @@ -17,7 +17,7 @@ from __future__ import division, print_function, absolute_import -from hypothesis.internal.compat import hrange, getfullargspec +from hypothesis.internal.compat import getfullargspec from hypothesis.internal.reflection import arg_string, \ convert_keyword_arguments, convert_positional_arguments from hypothesis.searchstrategy.strategies import SearchStrategy diff --git a/src/hypothesis/searchstrategy/strategies.py b/src/hypothesis/searchstrategy/strategies.py index 31d3e6fd422..eeca5befd41 100644 --- a/src/hypothesis/searchstrategy/strategies.py +++ b/src/hypothesis/searchstrategy/strategies.py @@ -20,19 +20,17 @@ from collections import defaultdict import hypothesis.internal.conjecture.utils as cu - -from hypothesis.core import find from hypothesis.errors import NoExamples, NoSuchExample, Unsatisfiable, \ UnsatisfiedAssumption from hypothesis.control import assume, reject, _current_build_context -from hypothesis._settings import settings, Verbosity, note_deprecation +from hypothesis._settings import Verbosity, settings, note_deprecation from hypothesis.internal.compat import hrange from hypothesis.utils.conventions import UniqueIdentifier from hypothesis.internal.lazyformat import lazyformat from hypothesis.internal.reflection import get_pretty_function_description if False: - from typing import Any, Set, Dict, Tuple, FrozenSet, DefaultDict + from typing import Any, Set, Dict, Tuple, FrozenSet, DefaultDict # noqa listener_type = DefaultDict['SearchStrategy', Set['SearchStrategy']] calculating = UniqueIdentifier('calculating') @@ -269,6 +267,7 @@ def example(self, random=None): '#drawing-interactively-in-tests for more details.' ) + # Conjecture will always try the zero example first. This would result # in us producing the same example each time, which is boring, so we # deliberately skip the first example it feeds us. @@ -281,7 +280,8 @@ def condition(x): first.append(x) return False try: - return find( + import hypothesis + return hypothesis.find( self, condition, random=random,