aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/hypothesis/py3
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2024-04-23 11:33:26 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2024-04-23 11:44:26 +0300
commit788be0726a19c2cbb4153cadd5a530fdaabf1cf9 (patch)
treefdfc620643a7ef071fcc4da70aee7c9dca086ecf /contrib/python/hypothesis/py3
parentb3463ec39aa72198a0df194f2d4a58a96e583aad (diff)
downloadydb-788be0726a19c2cbb4153cadd5a530fdaabf1cf9.tar.gz
Intermediate changes
Diffstat (limited to 'contrib/python/hypothesis/py3')
-rw-r--r--contrib/python/hypothesis/py3/.dist-info/METADATA2
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/internal/conjecture/data.py23
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/internal/conjecture/datatree.py10
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/internal/conjecture/pareto.py3
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/version.py2
-rw-r--r--contrib/python/hypothesis/py3/ya.make2
6 files changed, 31 insertions, 11 deletions
diff --git a/contrib/python/hypothesis/py3/.dist-info/METADATA b/contrib/python/hypothesis/py3/.dist-info/METADATA
index a4cff64dd9..5c622375cd 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.100.0
+Version: 6.100.1
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/data.py b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/data.py
index 701105bd5e..93f7758ba2 100644
--- a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/data.py
+++ b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/data.py
@@ -91,6 +91,9 @@ DRAW_FLOAT_LABEL = calc_label_from_name("drawing a float")
FLOAT_STRATEGY_DO_DRAW_LABEL = calc_label_from_name(
"getting another float in FloatStrategy"
)
+INTEGER_WEIGHTED_DISTRIBUTION = calc_label_from_name(
+ "drawing from a weighted distribution in integers"
+)
InterestingOrigin = Tuple[
Type[BaseException], str, int, Tuple[Any, ...], Tuple[Tuple[Any, ...], ...]
@@ -1673,6 +1676,7 @@ class HypothesisProvider(PrimitiveProvider):
center: Optional[int] = None,
forced: Optional[int] = None,
fake_forced: bool = False,
+ _vary_effective_size: bool = True,
) -> int:
assert lower <= upper
assert forced is None or lower <= forced <= upper
@@ -1709,14 +1713,27 @@ class HypothesisProvider(PrimitiveProvider):
bits = gap.bit_length()
probe = gap + 1
- if bits > 24 and self.draw_boolean(
- 7 / 8, forced=None if forced is None else False, fake_forced=fake_forced
+ if (
+ bits > 24
+ and _vary_effective_size
+ and self.draw_boolean(
+ 7 / 8, forced=None if forced is None else False, fake_forced=fake_forced
+ )
):
+ self._cd.start_example(INTEGER_WEIGHTED_DISTRIBUTION)
# For large ranges, we combine the uniform random distribution from draw_bits
# with a weighting scheme with moderate chance. Cutoff at 2 ** 24 so that our
# choice of unicode characters is uniform but the 32bit distribution is not.
idx = INT_SIZES_SAMPLER.sample(self._cd)
- bits = min(bits, INT_SIZES[idx])
+ force_bits = min(bits, INT_SIZES[idx])
+ forced = self._draw_bounded_integer(
+ lower=center if above else max(lower, center - 2**force_bits - 1),
+ upper=center if not above else min(upper, center + 2**force_bits - 1),
+ _vary_effective_size=False,
+ )
+ self._cd.stop_example()
+
+ assert lower <= forced <= upper
while probe > gap:
self._cd.start_example(INTEGER_RANGE_DRAW_LABEL)
diff --git a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/datatree.py b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/datatree.py
index 6ab4c2783f..c22cd0b294 100644
--- a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/datatree.py
+++ b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/datatree.py
@@ -30,6 +30,7 @@ from hypothesis.internal.conjecture.data import (
Status,
StringKWargs,
)
+from hypothesis.internal.escalation import InterestingOrigin
from hypothesis.internal.floats import (
count_between_floats,
float_to_int,
@@ -83,8 +84,8 @@ class Branch:
class Conclusion:
"""Represents a transition to a finished state."""
- status = attr.ib()
- interesting_origin = attr.ib()
+ status: Status = attr.ib()
+ interesting_origin: Optional[InterestingOrigin] = attr.ib()
# The number of max children where, beyond this, it is practically impossible
@@ -1043,8 +1044,9 @@ class TreeRecordingObserver(DataObserver):
or new_transition.status != Status.VALID
):
raise Flaky(
- f"Inconsistent test results! Test case was {node.transition!r} "
- f"on first run but {new_transition!r} on second"
+ f"Inconsistent results from replaying a test case!\n"
+ f" last: {node.transition.status.name} from {node.transition.interesting_origin}\n"
+ f" this: {new_transition.status.name} from {new_transition.interesting_origin}"
)
else:
node.transition = new_transition
diff --git a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/pareto.py b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/pareto.py
index 146b1b56f4..b43e6df5bc 100644
--- a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/pareto.py
+++ b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/pareto.py
@@ -133,10 +133,11 @@ class ParetoFront:
"""Attempts to add ``data`` to the pareto front. Returns True if
``data`` is now in the front, including if data is already in the
collection, and False otherwise"""
- data = data.as_result()
if data.status < Status.VALID:
return False
+ data = data.as_result()
+
if not self.front:
self.front.add(data)
return True
diff --git a/contrib/python/hypothesis/py3/hypothesis/version.py b/contrib/python/hypothesis/py3/hypothesis/version.py
index 158a440f0a..be22825634 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, 100, 0)
+__version_info__ = (6, 100, 1)
__version__ = ".".join(map(str, __version_info__))
diff --git a/contrib/python/hypothesis/py3/ya.make b/contrib/python/hypothesis/py3/ya.make
index 986fc7ae78..c899d543fd 100644
--- a/contrib/python/hypothesis/py3/ya.make
+++ b/contrib/python/hypothesis/py3/ya.make
@@ -2,7 +2,7 @@
PY3_LIBRARY()
-VERSION(6.100.0)
+VERSION(6.100.1)
LICENSE(MPL-2.0)