diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-02-23 10:47:37 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-02-23 10:58:53 +0300 |
commit | 0502345834ecaee02a5699c610ba2d1330c9619a (patch) | |
tree | 75ca1e38d924d7ca59b6829b1f0063caf77c4064 /contrib/python/hypothesis/py3 | |
parent | 4416a6af47242170c265e50e5af0c585567a741d (diff) | |
download | ydb-0502345834ecaee02a5699c610ba2d1330c9619a.tar.gz |
Intermediate changes
Diffstat (limited to 'contrib/python/hypothesis/py3')
5 files changed, 8 insertions, 4 deletions
diff --git a/contrib/python/hypothesis/py3/.dist-info/METADATA b/contrib/python/hypothesis/py3/.dist-info/METADATA index 21f727a546..c900020993 100644 --- a/contrib/python/hypothesis/py3/.dist-info/METADATA +++ b/contrib/python/hypothesis/py3/.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: hypothesis -Version: 6.98.2 +Version: 6.98.3 Summary: A library for property-based testing Home-page: https://hypothesis.works Author: David R. MacIver and Zac Hatfield-Dodds diff --git a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/junkdrawer.py b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/junkdrawer.py index 0da103a030..4a2140eccd 100644 --- a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/junkdrawer.py +++ b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/junkdrawer.py @@ -243,7 +243,7 @@ class LazySequenceCopy: return i -def clamp(lower: int, value: int, upper: int) -> int: +def clamp(lower: float, value: float, upper: float) -> float: """Given a value and lower/upper bounds, 'clamp' the value so that it satisfies lower <= value <= upper.""" return max(lower, min(value, upper)) diff --git a/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/utils.py b/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/utils.py index bd56d2287e..7bf0514d44 100644 --- a/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/utils.py +++ b/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/utils.py @@ -17,6 +17,7 @@ import attr from hypothesis.internal.cache import LRUReusedCache from hypothesis.internal.compat import dataclass_asdict +from hypothesis.internal.conjecture.junkdrawer import clamp from hypothesis.internal.floats import float_to_int from hypothesis.internal.reflection import proxies from hypothesis.vendor.pretty import pretty @@ -160,6 +161,9 @@ def to_jsonable(obj: object) -> object: """ if isinstance(obj, (str, int, float, bool, type(None))): if isinstance(obj, int) and abs(obj) >= 2**63: + # Silently clamp very large ints to max_float, to avoid + # OverflowError when casting to float. + obj = clamp(-sys.float_info.max, obj, sys.float_info.max) return float(obj) return obj if isinstance(obj, (list, tuple, set, frozenset)): diff --git a/contrib/python/hypothesis/py3/hypothesis/version.py b/contrib/python/hypothesis/py3/hypothesis/version.py index 843784dc96..2dddb0e5f2 100644 --- a/contrib/python/hypothesis/py3/hypothesis/version.py +++ b/contrib/python/hypothesis/py3/hypothesis/version.py @@ -8,5 +8,5 @@ # v. 2.0. If a copy of the MPL was not distributed with this file, You can # obtain one at https://mozilla.org/MPL/2.0/. -__version_info__ = (6, 98, 2) +__version_info__ = (6, 98, 3) __version__ = ".".join(map(str, __version_info__)) diff --git a/contrib/python/hypothesis/py3/ya.make b/contrib/python/hypothesis/py3/ya.make index 03a62edeb0..d818e87ba6 100644 --- a/contrib/python/hypothesis/py3/ya.make +++ b/contrib/python/hypothesis/py3/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(6.98.2) +VERSION(6.98.3) LICENSE(MPL-2.0) |