|
24 | 24 | @final
|
25 | 25 | @dataclasses.dataclass(frozen=True)
|
26 | 26 | class Settings:
|
27 |
| - """Settings for the law tests. |
| 27 | + """ |
| 28 | + Settings for the law tests. |
28 | 29 |
|
29 | 30 | This sets the context for each generated law test, by temporarily
|
30 | 31 | registering strategies for various types and passing any ``hypothesis``
|
@@ -76,11 +77,11 @@ def default_settings(container_type: type[Lawful]) -> Settings:
|
76 | 77 | We use some special strategies by default, but
|
77 | 78 | they can be overridden by the user if needed:
|
78 | 79 |
|
79 |
| - + `TypeVar`: We need to make sure that the values generated behave |
80 |
| - sensibly when tested for equality. |
| 80 | + - ``TypeVar``: We need to make sure that the values generated behave |
| 81 | + sensibly when tested for equality. |
81 | 82 |
|
82 |
| - + `collections.abc.Callable`: We need to generate pure functions, which |
83 |
| - are not the default. |
| 83 | + - ``collections.abc.Callable``: We need to generate pure functions, |
| 84 | + which are not the default. |
84 | 85 |
|
85 | 86 | Note that this is `collections.abc.Callable`, NOT `typing.Callable`. This
|
86 | 87 | is because, at runtime, `typing.get_origin(Callable[[int], str])` is
|
@@ -186,10 +187,11 @@ def pure_functions_factory(thing) -> st.SearchStrategy:
|
186 | 187 |
|
187 | 188 |
|
188 | 189 | def type_vars_factory(thing: type[object]) -> StrategyFactory:
|
189 |
| - """Strategy factory for ``TypeVar``s. |
| 190 | + """ |
| 191 | + Strategy factory for ``TypeVar`` objects. |
190 | 192 |
|
191 |
| - We ensure that values inside strategies are self-equal. For example, |
192 |
| - ``nan`` does not work for us. |
| 193 | + We ensure that values inside strategies are self-equal. |
| 194 | + For example, ``float('nan')`` does not work for us. |
193 | 195 | """
|
194 | 196 | return types.resolve_TypeVar(thing).filter( # type: ignore[no-any-return]
|
195 | 197 | lambda inner: inner == inner, # noqa: PLR0124, WPS312
|
|
0 commit comments