1# This file is part of Hypothesis, which may be found at
2# https://github.com/HypothesisWorks/hypothesis/
3#
4# Most of this work is copyright (C) 2013-2021 David R. MacIver
5# (david@drmaciver.com), but it contains contributions by others. See
6# CONTRIBUTING.rst for a full list of people who may hold copyright, and
7# consult the git log if you need to determine who owns an individual
8# contribution.
9#
10# This Source Code Form is subject to the terms of the Mozilla Public License,
11# v. 2.0. If a copy of the MPL was not distributed with this file, You can
12# obtain one at https://mozilla.org/MPL/2.0/.
13#
14# END HEADER
15
16from hypothesis.strategies._internal import SearchStrategy
17from hypothesis.strategies._internal.collections import tuples
18from hypothesis.strategies._internal.core import (
19    DataObject,
20    DrawFn,
21    binary,
22    booleans,
23    builds,
24    characters,
25    complex_numbers,
26    composite,
27    data,
28    decimals,
29    deferred,
30    dictionaries,
31    emails,
32    fixed_dictionaries,
33    fractions,
34    from_regex,
35    from_type,
36    frozensets,
37    functions,
38    iterables,
39    lists,
40    permutations,
41    random_module,
42    randoms,
43    recursive,
44    register_type_strategy,
45    runner,
46    sampled_from,
47    sets,
48    shared,
49    slices,
50    text,
51    uuids,
52)
53from hypothesis.strategies._internal.datetime import (
54    dates,
55    datetimes,
56    timedeltas,
57    times,
58    timezone_keys,
59    timezones,
60)
61from hypothesis.strategies._internal.ipaddress import ip_addresses
62from hypothesis.strategies._internal.misc import just, none, nothing
63from hypothesis.strategies._internal.numbers import floats, integers
64from hypothesis.strategies._internal.strategies import one_of
65from hypothesis.strategies._internal.utils import _strategies
66
67# The implementation of all of these lives in `_strategies.py`, but we
68# re-export them via this module to avoid exposing implementation details
69# to over-zealous tab completion in editors that do not respect __all__.
70
71
72__all__ = [
73    "binary",
74    "booleans",
75    "builds",
76    "characters",
77    "complex_numbers",
78    "composite",
79    "data",
80    "DataObject",
81    "dates",
82    "datetimes",
83    "decimals",
84    "deferred",
85    "dictionaries",
86    "DrawFn",
87    "emails",
88    "fixed_dictionaries",
89    "floats",
90    "fractions",
91    "from_regex",
92    "from_type",
93    "frozensets",
94    "functions",
95    "integers",
96    "ip_addresses",
97    "iterables",
98    "just",
99    "lists",
100    "none",
101    "nothing",
102    "one_of",
103    "permutations",
104    "random_module",
105    "randoms",
106    "recursive",
107    "register_type_strategy",
108    "runner",
109    "sampled_from",
110    "sets",
111    "shared",
112    "slices",
113    "text",
114    "timedeltas",
115    "times",
116    "timezone_keys",
117    "timezones",
118    "tuples",
119    "uuids",
120    "SearchStrategy",
121]
122
123
124def _check_exports(_public):
125    assert set(__all__) == _public, (set(__all__) - _public, _public - set(__all__))
126
127    # Verify that all exported strategy functions were registered with
128    # @declares_strategy.
129    exported_strategies = set(__all__) - {
130        "DataObject",
131        "DrawFn",
132        "SearchStrategy",
133        "composite",
134        "register_type_strategy",
135    }
136    assert set(_strategies) == exported_strategies, (
137        set(_strategies) - exported_strategies,
138        exported_strategies - set(_strategies),
139    )
140
141
142_check_exports({n for n in dir() if n[0] not in "_@"})
143del _check_exports
144