hypothesis API reference
62 public APIs from hypothesis (HypothesisWorks/hypothesis) — 23 classes, 23 functions, 16 methods. Signatures extracted by static analysis of the actual source.
Repository: HypothesisWorks/hypothesis
| Kind | Count |
|---|---|
| Classes | 23 |
| Functions | 23 |
| Methods | 16 |
API list
func
hypothesis.src._hypothesis_ftz_detector.modules_imported_by(mod:str) -> FTZCulpritsReturn the set of modules imported transitively by mod.
class
hypothesis.src.hypothesis._settings.durationA timedelta specifically measured in milliseconds.
func
hypothesis.src.hypothesis.control.event(value:str, payload:Any='') -> NoneRecord an event that occurred during this test.
func
hypothesis.src.hypothesis.control.note(value:object) -> NoneRecord a note on this |test case|.
func
hypothesis.src.hypothesis.core.seed(seed:Hashable) -> Callable[[TestFunc], TestFunc]Seed the randomness for this test.
method
hypothesis.src.hypothesis.database.ExampleDatabase.add_listener(f:ListenerT) -> NoneAdd a change listener.
method
hypothesis.src.hypothesis.database.ExampleDatabase.clear_listeners() -> NoneRemove all change listeners.
method
hypothesis.src.hypothesis.database.ExampleDatabase.delete(key:bytes, value:bytes) -> NoneRemove ``value`` from ``key``.
method
hypothesis.src.hypothesis.database.ExampleDatabase.fetch(key:bytes) -> Iterable[bytes]Return an iterable over all values matching this key.
method
hypothesis.src.hypothesis.database.ExampleDatabase.move(src:bytes, dest:bytes, value:bytes) -> NoneMove ``value`` from key ``src`` to key ``dest``.
method
hypothesis.src.hypothesis.database.ExampleDatabase.remove_listener(f:ListenerT) -> NoneRemoves ``f`` from the list of change listeners.
method
hypothesis.src.hypothesis.database.ExampleDatabase.save(key:bytes, value:bytes) -> NoneSave ``value`` under ``key``.
class
hypothesis.src.hypothesis.database.MultiplexedDatabaseA wrapper around multiple databases.
class
hypothesis.src.hypothesis.database.ReadOnlyDatabaseA wrapper to make the given database read-only.
func
hypothesis.src.hypothesis.database.choices_from_bytes(buffer:bytes) -> tuple[ChoiceT, ...] | NoneDeserialize a bytestring to a tuple of choices.
func
hypothesis.src.hypothesis.database.choices_to_bytes(choices:Iterable[ChoiceT]) -> bytesSerialize a list of choices to a bytestring.
class
hypothesis.src.hypothesis.errors.ChoiceTooLargeAn internal error raised by choice_from_index.
class
hypothesis.src.hypothesis.errors.FailedHealthCheckRaised when a test fails a health check.
class
hypothesis.src.hypothesis.errors.FlakyBase class for indeterministic failures.
class
hypothesis.src.hypothesis.errors.FoundSignal that the example matches condition.
class
hypothesis.src.hypothesis.errors.HypothesisDeprecationWarningA deprecation warning issued by Hypothesis.
class
hypothesis.src.hypothesis.errors.HypothesisExceptionGeneric parent class for exceptions thrown by Hypothesis.
class
hypothesis.src.hypothesis.errors.HypothesisWarningA generic warning issued by Hypothesis.
class
hypothesis.src.hypothesis.errors.UnsatisfiedAssumptionAn internal error raised by assume.
func
hypothesis.src.hypothesis.extra.cli.obj_name(s:str) -> objectThis "type" imports whatever object is named by a dotted string.
func
hypothesis.src.hypothesis.extra.lark.get_terminal_names(terminals:list[TerminalDef], rules:list[Rule], ignore_names:list[str]) -> set[str]Get names of all terminals in the grammar.
func
hypothesis.src.hypothesis.extra.numpy.boolean_dtypes() -> st.SearchStrategy['np.dtype[np.bool_]']Return a strategy for boolean dtypes.
class
hypothesis.src.hypothesis.extra.pandas.impl.columnData object for describing a column in a DataFrame.
class
hypothesis.src.hypothesis.internal.cache.GenericCacheGeneric supertype for cache implementations.
method
hypothesis.src.hypothesis.internal.cache.GenericCache.check_valid() -> NoneDebugging method for use in tests.
method
hypothesis.src.hypothesis.internal.cache.GenericCache.clear() -> NoneRemove all keys, regardless of their pinned status.
method
hypothesis.src.hypothesis.internal.cache.GenericCache.is_pinned(key:K) -> boolReturns True if the key is currently pinned.
method
hypothesis.src.hypothesis.internal.cache.GenericCache.pin(key:K, value:V) -> NoneMark ``key`` as pinned (with the given value).
method
hypothesis.src.hypothesis.internal.cache.GenericCache.unpin(key:K) -> NoneUndo one previous call to ``pin(key)``.
method
hypothesis.src.hypothesis.internal.conjecture.data.Span.choice_count() -> intThe number of choices in this span.
method
hypothesis.src.hypothesis.internal.conjecture.data.Span.depth() -> intDepth of this span in the span tree.
class
hypothesis.src.hypothesis.internal.conjecture.datatree.ConclusionRepresents a transition to a finished state.
method
hypothesis.src.hypothesis.internal.conjecture.datatree.TreeNode.mark_forced(i:int) -> NoneNote that the draw at node i was forced.
func
hypothesis.src.hypothesis.internal.conjecture.floats.reverse64(v:int) -> intReverse a 64-bit integer bitwise.
func
hypothesis.src.hypothesis.internal.conjecture.junkdrawer.stack_depth_of_caller() -> intGet stack size for caller's frame.
func
hypothesis.src.hypothesis.internal.conjecture.shrinking.choicetree.random_selection_order(random:Random) -> Callable[[int, int], Iterable[int]]Select choices uniformly at random.
class
hypothesis.src.hypothesis.internal.conjecture.shrinking.integer.IntegerAttempts to find a smaller integer.
func
hypothesis.src.hypothesis.internal.conjecture.utils.fisher_yates_shuffle(data:'ConjectureData', ls:list[T]) -> NoneShuffle ``ls`` in place, drawing from ``data``.
class
hypothesis.src.hypothesis.internal.conjecture.utils.manyUtility class for collections.
method
hypothesis.src.hypothesis.internal.conjecture.utils.many.reject(why:str | None=None) -> NoneReject the last example (i.e.
func
hypothesis.src.hypothesis.internal.filtering.get_numeric_predicate_bounds(predicate:Predicate) -> ConstructivePredicateShared logic for understanding numeric bounds.
func
hypothesis.src.hypothesis.internal.floats.sign_aware_lte(x:float | int, y:float | int) -> boolLess-than-or-equals, but strictly orders -0.0 and 0.0
func
hypothesis.src.hypothesis.internal.observability.add_observability_callback(f:CallbackT, *all_threads:bool=False) -> NoneAdds ``f`` as a callback for |observability|.
func
hypothesis.src.hypothesis.internal.observability.remove_observability_callback(f:CallbackT) -> NoneRemoves ``f`` from the |observability| callbacks.
func
hypothesis.src.hypothesis.internal.reflection.is_first_param_referenced_in_function(f:Any) -> boolIs the given name referenced within f?
func
hypothesis.src.hypothesis.internal.reflection.is_mock(obj:object) -> boolDetermine if the given argument is a mock type.
class
hypothesis.src.hypothesis.internal.scrutineer.TracerA super-simple branch coverage tracer.
func
hypothesis.src.hypothesis.internal.statistics.stdtr(df:int, t:float) -> floatStudent's t CDF for integer df >= 1, evaluated at t.
class
hypothesis.src.hypothesis.stateful.BundleA collection of values for use in stateful testing.
func
hypothesis.src.hypothesis.strategies._internal.core.binary(*min_size:int=0, *max_size:int | None=None) -> SearchStrategy[bytes]Generates :class:`python:bytes`.
class
hypothesis.src.hypothesis.strategies._internal.misc.JustStrategyA strategy which always returns a single fixed value.
func
hypothesis.src.hypothesis.strategies._internal.misc.just(value:T) -> SearchStrategy[T]Return a strategy which only generates ``value``.
func
hypothesis.src.hypothesis.strategies._internal.misc.none() -> SearchStrategy[None]Return a strategy which only generates None.
class
hypothesis.src.hypothesis.strategies._internal.numbers.FloatStrategyA strategy for floating point numbers.
class
hypothesis.src.hypothesis.strategies._internal.strategies.OneOfStrategyImplements a union of strategies.
class
hypothesis.src.hypothesis.utils.conventions.UniqueIdentifierA factory for sentinel objects with nice reprs.
class
hypothesis.src.hypothesis.utils.threading.ThreadLocalManages thread-local state.
About this data
These signatures were extracted from the public source of HypothesisWorks/hypothesis
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.