diff options
| author | robot-piglet <[email protected]> | 2024-03-27 09:51:04 +0300 |
|---|---|---|
| committer | robot-piglet <[email protected]> | 2024-03-27 09:58:33 +0300 |
| commit | b3c5477f607ee99434ff2d14d03c08f4cd460b3e (patch) | |
| tree | 7f13ef2c823cd69dd03caeb18edc1e2808916a0f /contrib/python/hypothesis/py3 | |
| parent | eeac4554b5f997b04ffef0d9912ddfcb7ddbc549 (diff) | |
Intermediate changes
Diffstat (limited to 'contrib/python/hypothesis/py3')
5 files changed, 12 insertions, 7 deletions
diff --git a/contrib/python/hypothesis/py3/.dist-info/METADATA b/contrib/python/hypothesis/py3/.dist-info/METADATA index e8d710ced7c..ff84629a91b 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.99.4 +Version: 6.99.5 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 486709edbb8..40850a2b5b2 100644 --- a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/data.py +++ b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/data.py @@ -1693,7 +1693,7 @@ class ConjectureData: if observer is None: observer = DataObserver() assert isinstance(observer, DataObserver) - self.__bytes_drawn = 0 + self._bytes_drawn = 0 self.observer = observer self.max_length = max_length self.is_find = False @@ -2264,8 +2264,8 @@ class ConjectureData: if forced is not None: buf = int_to_bytes(forced, n_bytes) - elif self.__bytes_drawn < len(self.__prefix): - index = self.__bytes_drawn + elif self._bytes_drawn < len(self.__prefix): + index = self._bytes_drawn buf = self.__prefix[index : index + n_bytes] if len(buf) < n_bytes: assert self.__random is not None @@ -2274,7 +2274,7 @@ class ConjectureData: assert self.__random is not None buf = uniform(self.__random, n_bytes) buf = bytearray(buf) - self.__bytes_drawn += n_bytes + self._bytes_drawn += n_bytes assert len(buf) == n_bytes diff --git a/contrib/python/hypothesis/py3/hypothesis/stateful.py b/contrib/python/hypothesis/py3/hypothesis/stateful.py index 58a22771617..d5af39b5c0d 100644 --- a/contrib/python/hypothesis/py3/hypothesis/stateful.py +++ b/contrib/python/hypothesis/py3/hypothesis/stateful.py @@ -49,6 +49,7 @@ from hypothesis.core import TestFunc, given from hypothesis.errors import InvalidArgument, InvalidDefinition from hypothesis.internal.compat import add_note from hypothesis.internal.conjecture import utils as cu +from hypothesis.internal.conjecture.engine import BUFFER_SIZE from hypothesis.internal.healthcheck import fail_health_check from hypothesis.internal.observability import TESTCASE_CALLBACKS from hypothesis.internal.reflection import ( @@ -151,6 +152,10 @@ def run_state_machine_as_test(state_machine_factory, *, settings=None, _min_step must_stop = True elif steps_run <= _min_steps: must_stop = False + elif cd._bytes_drawn > (0.8 * BUFFER_SIZE): + # Better to stop after fewer steps, than always overrun and retry. + # See https://github.com/HypothesisWorks/hypothesis/issues/3618 + must_stop = True start_draw = perf_counter() if cd.draw_boolean(p=2**-16, forced=must_stop): diff --git a/contrib/python/hypothesis/py3/hypothesis/version.py b/contrib/python/hypothesis/py3/hypothesis/version.py index 2b269394e55..19c05ed3e74 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, 99, 4) +__version_info__ = (6, 99, 5) __version__ = ".".join(map(str, __version_info__)) diff --git a/contrib/python/hypothesis/py3/ya.make b/contrib/python/hypothesis/py3/ya.make index d365120737c..68834541fd9 100644 --- a/contrib/python/hypothesis/py3/ya.make +++ b/contrib/python/hypothesis/py3/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(6.99.4) +VERSION(6.99.5) LICENSE(MPL-2.0) |
