Skip to content

Commit 5964b65

Browse files
committed
reword recommendation
1 parent 915a8d5 commit 5964b65

File tree

1 file changed

+8
-5
lines changed
  • hypothesis-python/src/hypothesis/internal/conjecture

1 file changed

+8
-5
lines changed

hypothesis-python/src/hypothesis/internal/conjecture/providers.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@
8282
#:
8383
#: * A string corresponding to an importable absolute path of a
8484
#: |PrimitiveProvider| subclass
85-
#: * A |PrimitiveProvider| subclass (the class itself, not an instance)
85+
#: * A |PrimitiveProvider| subclass (the class itself, not an instance of the
86+
#: class)
8687
#:
8788
#: Hypothesis will instantiate the corresponding |PrimitiveProvider| subclass
8889
#: when the backend is requested by a test's |settings.backend| value.
@@ -111,10 +112,12 @@
111112
#: Though, as ``backend="hypothesis"`` is the default setting, the above would
112113
#: typically not have any effect.
113114
#:
114-
#: If you maintain a third-party backend, we strongly recommend providing an
115-
#: absolute importable path, rather than a |PrimitiveProvider| class. Hypothesis
116-
#: will defer importing class paths until required, which improves startup times
117-
#: for tests which don't request the backend.
115+
#: For third-party backend authors, we strongly encourage ensuring that
116+
#: ``import hypothesis`` does not automatically import the expensive parts of
117+
#: your package, by:
118+
#: - setting a string path here, instead of a provider class
119+
#: - ensuring the registered hypothesis plugin path references a path which just
120+
#: sets AVAILABLE_PROVIDERS and does not import your package
118121
AVAILABLE_PROVIDERS: dict[str, Union[str, type["PrimitiveProvider"]]] = {
119122
"hypothesis": "hypothesis.internal.conjecture.providers.HypothesisProvider",
120123
"hypothesis-urandom": "hypothesis.internal.conjecture.providers.URandomProvider",

0 commit comments

Comments
 (0)