diff options
| author | robot-piglet <[email protected]> | 2025-12-12 13:17:11 +0300 |
|---|---|---|
| committer | robot-piglet <[email protected]> | 2025-12-12 13:35:29 +0300 |
| commit | 3dbb803cfc6bfe14cb471126110c4f558130e309 (patch) | |
| tree | 603e35852665909c8ab6450429e4ac77c5b37461 /contrib/python/hypothesis | |
| parent | a89cff504d647d0988b75396aba8d67211e0ce66 (diff) | |
Intermediate changes
commit_hash:38e862c546aa268aac841565d1cc3f70df797d15
Diffstat (limited to 'contrib/python/hypothesis')
5 files changed, 27 insertions, 28 deletions
diff --git a/contrib/python/hypothesis/py3/.dist-info/METADATA b/contrib/python/hypothesis/py3/.dist-info/METADATA index cb4737ae78b..671b206e703 100644 --- a/contrib/python/hypothesis/py3/.dist-info/METADATA +++ b/contrib/python/hypothesis/py3/.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.4 Name: hypothesis -Version: 6.148.2 +Version: 6.148.3 Summary: The property-based testing library for Python Author-email: "David R. MacIver and Zac Hatfield-Dodds" <[email protected]> License-Expression: MPL-2.0 @@ -30,7 +30,7 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Topic :: Education :: Testing Classifier: Topic :: Software Development :: Testing Classifier: Typing :: Typed -Requires-Python: >=3.10.2 +Requires-Python: >=3.10 Description-Content-Type: text/markdown License-File: LICENSE.txt Requires-Dist: exceptiongroup>=1.0.0; python_version < "3.11" diff --git a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/shrinker.py b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/shrinker.py index 204b794345c..8b5af7f6138 100644 --- a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/shrinker.py +++ b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/shrinker.py @@ -710,10 +710,12 @@ class Shrinker: continue self.incorporate_test_data(random_attempt) for j in spans: - initial_ex = initial.spans[j] - attempt_ex = random_attempt.spans[j] - contents = random_attempt.nodes[attempt_ex.start : attempt_ex.end] - self.consider_new_nodes(nodes[:i] + contents + nodes[initial_ex.end :]) + initial_span = initial.spans[j] + attempt_span = random_attempt.spans[j] + contents = random_attempt.nodes[attempt_span.start : attempt_span.end] + self.consider_new_nodes( + nodes[:i] + contents + nodes[initial_span.end :] + ) if initial is not self.shrink_target: return True return False @@ -1558,8 +1560,8 @@ class Shrinker: prev = self.shrink_target nodes = self.shrink_target.nodes - ex = self.spans[i] - prefix = nodes[: ex.start] + span = self.spans[i] + prefix = nodes[: span.start] replacement = tuple( [ ( @@ -1569,18 +1571,18 @@ class Shrinker: with_value=choice_from_index(0, node.type, node.constraints) ) ) - for node in nodes[ex.start : ex.end] + for node in nodes[span.start : span.end] ] ) - suffix = nodes[ex.end :] + suffix = nodes[span.end :] attempt = self.cached_test_function(prefix + replacement + suffix)[1] if self.shrink_target is not prev: return if isinstance(attempt, ConjectureResult): - new_ex = attempt.spans[i] - new_replacement = attempt.nodes[new_ex.start : new_ex.end] + new_span = attempt.spans[i] + new_replacement = attempt.nodes[new_span.start : new_span.end] self.consider_new_nodes(prefix + new_replacement + suffix) def minimize_individual_choices(self, chooser): @@ -1660,8 +1662,8 @@ class Shrinker: hi = len(self.spans) while lo + 1 < hi: mid = (lo + hi) // 2 - ex = self.spans[mid] - if ex.start >= node.index: + span = self.spans[mid] + if span.start >= node.index: hi = mid else: lo = mid @@ -1672,13 +1674,13 @@ class Shrinker: # consecutive nodes (that don't cross a span boundary) for say # n <= 2 or n <= 3. if chooser.choose([True, False]): - ex = self.spans[ + span = self.spans[ chooser.choose( range(first_span_after_node, len(self.spans)), lambda i: self.spans[i].choice_count > 0, ) ] - self.consider_new_nodes(lowered[: ex.start] + lowered[ex.end :]) + self.consider_new_nodes(lowered[: span.start] + lowered[span.end :]) else: node = self.nodes[chooser.choose(range(node.index + 1, len(self.nodes)))] self.consider_new_nodes(lowered[: node.index] + lowered[node.index + 1 :]) @@ -1702,14 +1704,15 @@ class Shrinker: ``x=""``, ``y="0"``, or the other way around. With reordering it will reliably fail with ``x=""``, ``y="0"``. """ - ex = chooser.choose(self.spans) - label = chooser.choose(ex.children).label + span = chooser.choose(self.spans) - spans = [c for c in ex.children if c.label == label] + label = chooser.choose(span.children).label + spans = [c for c in span.children if c.label == label] if len(spans) <= 1: return + + endpoints = [(span.start, span.end) for span in spans] st = self.shrink_target - endpoints = [(ex.start, ex.end) for ex in spans] Ordering.shrink( range(len(spans)), diff --git a/contrib/python/hypothesis/py3/hypothesis/stateful.py b/contrib/python/hypothesis/py3/hypothesis/stateful.py index 22596158397..185b71d9ad6 100644 --- a/contrib/python/hypothesis/py3/hypothesis/stateful.py +++ b/contrib/python/hypothesis/py3/hypothesis/stateful.py @@ -37,9 +37,9 @@ from hypothesis.control import _current_build_context, current_build_context from hypothesis.core import TestFunc, given from hypothesis.errors import InvalidArgument, InvalidDefinition from hypothesis.internal.compat import add_note, batched -from hypothesis.internal.conjecture import utils as cu from hypothesis.internal.conjecture.engine import BUFFER_SIZE from hypothesis.internal.conjecture.junkdrawer import gc_cumulative_time +from hypothesis.internal.conjecture.utils import calc_label_from_name from hypothesis.internal.healthcheck import fail_health_check from hypothesis.internal.observability import observability_enabled from hypothesis.internal.reflection import ( @@ -60,8 +60,7 @@ from hypothesis.strategies._internal.strategies import ( from hypothesis.vendor.pretty import RepresentationPrinter T = TypeVar("T") -STATE_MACHINE_RUN_LABEL = cu.calc_label_from_name("another state machine step") -SHOULD_CONTINUE_LABEL = cu.calc_label_from_name("should we continue drawing") +STATE_MACHINE_RUN_LABEL = calc_label_from_name("another state machine step") def _is_singleton(obj: object) -> bool: @@ -1075,9 +1074,6 @@ def invariant(*, check_during_init: bool = False) -> Callable[[TestFunc], TestFu return accept -LOOP_LABEL = cu.calc_label_from_name("RuleStrategy loop iteration") - - class RuleStrategy(SearchStrategy): def __init__(self, machine: RuleBasedStateMachine) -> None: super().__init__() diff --git a/contrib/python/hypothesis/py3/hypothesis/version.py b/contrib/python/hypothesis/py3/hypothesis/version.py index d3e27f7d295..1b08ee8bf45 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, 148, 2) +__version_info__ = (6, 148, 3) __version__ = ".".join(map(str, __version_info__)) diff --git a/contrib/python/hypothesis/py3/ya.make b/contrib/python/hypothesis/py3/ya.make index 4bb66229227..418f430ae2a 100644 --- a/contrib/python/hypothesis/py3/ya.make +++ b/contrib/python/hypothesis/py3/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(6.148.2) +VERSION(6.148.3) LICENSE(MPL-2.0) |
