Skip to content

Commit 5b14706

Browse files
build(deps): bump hypothesis from 5.44.0 to 6.3.0 (pydantic#2388)
* build(deps): bump hypothesis from 5.44.0 to 6.3.0 Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 5.44.0 to 6.3.0. - [Release notes](https://github.com/HypothesisWorks/hypothesis/releases) - [Commits](HypothesisWorks/hypothesis@hypothesis-python-5.44.0...hypothesis-python-6.3.0) Signed-off-by: dependabot[bot] <[email protected]> * Tweak Hypothesis / Json Fixing a tricky interaction around priority with subclassing and metaclasses. Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 53cf3cb commit 5b14706

5 files changed

+7
-8
lines changed

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ansi2html==1.6.0
22
flake8==3.8.4
33
flake8-quotes==3.2.0
4-
hypothesis==5.44.0
4+
hypothesis==6.3.0
55
mkdocs==1.1.2
66
mkdocs-exclude==1.0.2
77
mkdocs-material==6.2.8

pydantic/_hypothesis_plugin.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,11 @@ def add_luhn_digit(card_number: str) -> str:
152152
st.register_type_strategy(pydantic.IPvAnyAddress, st.ip_addresses())
153153
st.register_type_strategy(
154154
pydantic.IPvAnyInterface,
155-
st.from_type(ipaddress.IPv4Interface) | st.from_type(ipaddress.IPv6Interface),
155+
st.from_type(ipaddress.IPv4Interface) | st.from_type(ipaddress.IPv6Interface), # type: ignore[arg-type]
156156
)
157157
st.register_type_strategy(
158158
pydantic.IPvAnyNetwork,
159-
st.from_type(ipaddress.IPv4Network) | st.from_type(ipaddress.IPv6Network),
159+
st.from_type(ipaddress.IPv4Network) | st.from_type(ipaddress.IPv6Network), # type: ignore[arg-type]
160160
)
161161

162162
# We hook into the con***() functions and the ConstrainedNumberMeta metaclass,
@@ -212,7 +212,6 @@ def inner(f): # type: ignore
212212
# Type-to-strategy resolver functions
213213

214214

215-
@resolves(pydantic.Json)
216215
@resolves(pydantic.JsonWrapper)
217216
def resolve_json(cls): # type: ignore[no-untyped-def]
218217
try:
@@ -221,7 +220,7 @@ def resolve_json(cls): # type: ignore[no-untyped-def]
221220
finite = st.floats(allow_infinity=False, allow_nan=False)
222221
inner = st.recursive(
223222
base=st.one_of(st.none(), st.booleans(), st.integers(), finite, st.text()),
224-
extend=lambda x: st.lists(x) | st.dictionaries(st.text(), x),
223+
extend=lambda x: st.lists(x) | st.dictionaries(st.text(), x), # type: ignore
225224
)
226225
return st.builds(
227226
json.dumps,
@@ -347,3 +346,4 @@ def resolve_constr(cls): # type: ignore[no-untyped-def] # pragma: no cover
347346
for typ in pydantic.types._DEFINED_TYPES:
348347
_registered(typ)
349348
pydantic.types._registered = _registered
349+
st.register_type_strategy(pydantic.Json, resolve_json)

tests/requirements-linting.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
black==20.8b1
22
flake8==3.8.4
33
flake8-quotes==3.2.0
4-
hypothesis==5.44.0
4+
hypothesis==6.3.0
55
isort==5.7.0
66
mypy==0.812
77
pycodestyle==2.6.0

tests/requirements-testing.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
coverage==5.4
2-
hypothesis==5.44.0
2+
hypothesis==6.3.0
33
# pin importlib-metadata as upper versions need typing-extensions to work if on python < 3.8
44
importlib-metadata==3.1.0;python_version<"3.8"
55
mypy==0.812

tests/test_hypothesis_plugin.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ class NumbersModel(pydantic.BaseModel):
6363
nonnegfloat: pydantic.NonNegativeFloat
6464

6565
class JsonModel(pydantic.BaseModel):
66-
json_any: pydantic.Json
6766
json_int: pydantic.Json[int]
6867
json_float: pydantic.Json[float]
6968
json_str: pydantic.Json[str]

0 commit comments

Comments
 (0)