|
82 | 82 | #: |
83 | 83 | #: * A string corresponding to an importable absolute path of a |
84 | 84 | #: |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) |
86 | 87 | #: |
87 | 88 | #: Hypothesis will instantiate the corresponding |PrimitiveProvider| subclass |
88 | 89 | #: when the backend is requested by a test's |settings.backend| value. |
|
111 | 112 | #: Though, as ``backend="hypothesis"`` is the default setting, the above would |
112 | 113 | #: typically not have any effect. |
113 | 114 | #: |
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 |
118 | 121 | AVAILABLE_PROVIDERS: dict[str, Union[str, type["PrimitiveProvider"]]] = { |
119 | 122 | "hypothesis": "hypothesis.internal.conjecture.providers.HypothesisProvider", |
120 | 123 | "hypothesis-urandom": "hypothesis.internal.conjecture.providers.URandomProvider", |
|
0 commit comments