diff options
| author | robot-piglet <[email protected]> | 2024-02-01 10:32:16 +0300 |
|---|---|---|
| committer | robot-piglet <[email protected]> | 2024-02-01 10:54:14 +0300 |
| commit | f8ac779b44800eaefbf8fe82d5c3e1389905ed5d (patch) | |
| tree | 5802ca850f60420f36744062aaeb5728009d49c0 | |
| parent | be250f6ff0e19999659615378a17bd389d53a569 (diff) | |
Intermediate changes
8 files changed, 27 insertions, 39 deletions
diff --git a/contrib/python/hypothesis/py3/.dist-info/METADATA b/contrib/python/hypothesis/py3/.dist-info/METADATA index c94200ebd37..d32ce6bcf34 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.94.0 +Version: 6.96.0 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/control.py b/contrib/python/hypothesis/py3/hypothesis/control.py index 5b662197a79..92b26069c5a 100644 --- a/contrib/python/hypothesis/py3/hypothesis/control.py +++ b/contrib/python/hypothesis/py3/hypothesis/control.py @@ -23,7 +23,7 @@ from hypothesis.internal.reflection import get_pretty_function_description from hypothesis.internal.validation import check_type from hypothesis.reporting import report, verbose_report from hypothesis.utils.dynamicvariables import DynamicVariable -from hypothesis.vendor.pretty import IDKey +from hypothesis.vendor.pretty import IDKey, pretty def _calling_function_name(frame): @@ -167,9 +167,11 @@ def should_note(): return context.is_final or settings.default.verbosity >= Verbosity.verbose -def note(value: str) -> None: +def note(value: object) -> None: """Report this value for the minimal failing example.""" if should_note(): + if not isinstance(value, str): + value = pretty(value) report(value) diff --git a/contrib/python/hypothesis/py3/hypothesis/core.py b/contrib/python/hypothesis/py3/hypothesis/core.py index 75f1cc70e98..17876c37157 100644 --- a/contrib/python/hypothesis/py3/hypothesis/core.py +++ b/contrib/python/hypothesis/py3/hypothesis/core.py @@ -920,11 +920,11 @@ class StateForActualGivenExecution: except TypeError as e: # If we sampled from a sequence of strategies, AND failed with a # TypeError, *AND that exception mentions SearchStrategy*, add a note: - if "SearchStrategy" in str(e): - try: - add_note(e, data._sampled_from_all_strategies_elements_message) - except AttributeError: - pass + if "SearchStrategy" in str(e) and hasattr( + data, "_sampled_from_all_strategies_elements_message" + ): + msg, format_arg = data._sampled_from_all_strategies_elements_message + add_note(e, msg.format(format_arg)) raise # self.test_runner can include the execute_example method, or setup/teardown diff --git a/contrib/python/hypothesis/py3/hypothesis/internal/reflection.py b/contrib/python/hypothesis/py3/hypothesis/internal/reflection.py index d5ea7161f3b..e62ab28f36a 100644 --- a/contrib/python/hypothesis/py3/hypothesis/internal/reflection.py +++ b/contrib/python/hypothesis/py3/hypothesis/internal/reflection.py @@ -19,6 +19,7 @@ import re import sys import textwrap import types +import warnings from functools import partial, wraps from io import StringIO from keyword import iskeyword @@ -27,6 +28,7 @@ from types import ModuleType from typing import TYPE_CHECKING, Any, Callable from unittest.mock import _patch as PatchType +from hypothesis.errors import HypothesisWarning from hypothesis.internal.compat import PYPY, is_typed_named_tuple from hypothesis.utils.conventions import not_set from hypothesis.vendor.pretty import pretty @@ -478,6 +480,15 @@ def repr_call(f, args, kwargs, *, reorder=True): rep = nicerepr(f) if rep.startswith("lambda") and ":" in rep: rep = f"({rep})" + repr_len = len(rep) + sum(len(b) for b in bits) # approx + if repr_len > 30000: + warnings.warn( + "Generating overly large repr. This is an expensive operation, and with " + f"a length of {repr_len//1000} kB is is unlikely to be useful. Use -Wignore " + "to ignore the warning, or -Werror to get a traceback.", + HypothesisWarning, + stacklevel=2, + ) return rep + "(" + ", ".join(bits) + ")" diff --git a/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/strategies.py b/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/strategies.py index d2b33f2673d..70deaccc26f 100644 --- a/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/strategies.py +++ b/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/strategies.py @@ -531,18 +531,10 @@ class SampledFromStrategy(SearchStrategy): if isinstance(result, SearchStrategy) and all( isinstance(x, SearchStrategy) for x in self.elements ): - max_num_strats = 3 - preamble = ( - f"(first {max_num_strats}) " - if len(self.elements) > max_num_strats - else "" - ) - strat_reprs = ", ".join( - map(get_pretty_function_description, self.elements[:max_num_strats]) - ) data._sampled_from_all_strategies_elements_message = ( "sample_from was given a collection of strategies: " - f"{preamble}{strat_reprs}. Was one_of intended?" + "{!r}. Was one_of intended?", + self.elements, ) if result is filter_not_satisfied: data.mark_invalid(f"Aborted test because unable to satisfy {self!r}") diff --git a/contrib/python/hypothesis/py3/hypothesis/version.py b/contrib/python/hypothesis/py3/hypothesis/version.py index fd4613cb616..74dd286d5c3 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, 94, 0) +__version_info__ = (6, 96, 0) __version__ = ".".join(map(str, __version_info__)) diff --git a/contrib/python/hypothesis/py3/ya.make b/contrib/python/hypothesis/py3/ya.make index 476e93730ed..f868902be47 100644 --- a/contrib/python/hypothesis/py3/ya.make +++ b/contrib/python/hypothesis/py3/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(6.94.0) +VERSION(6.96.0) LICENSE(MPL-2.0) diff --git a/yt/yt/core/concurrency/config.cpp b/yt/yt/core/concurrency/config.cpp index acd8194e2f7..b6e3379d771 100644 --- a/yt/yt/core/concurrency/config.cpp +++ b/yt/yt/core/concurrency/config.cpp @@ -30,25 +30,8 @@ void TPeriodicExecutorOptionsSerializer::Register(TRegistrar registrar) //////////////////////////////////////////////////////////////////////////////// -void TRetryingPeriodicExecutorOptionsSerializer::Register(TRegistrar registrar) -{ - //! NB(arkady-e1ppa): Defaults and preprocessors of derived class - //! override defaults and overrides of base class and base class fields - registrar.ExternalPreprocessor([] (TThat* options) { - *options = TRetryingPeriodicExecutorOptions{ - { - .Period = TDuration::Seconds(5), - .Splay = TDuration::Seconds(1), - .Jitter = 0.0, - }, - { - .MinBackoff = TDuration::Seconds(5), - .MaxBackoff = TDuration::Seconds(60), - .BackoffMultiplier = 2.0, - }, - }; - }); -} +void TRetryingPeriodicExecutorOptionsSerializer::Register(TRegistrar /*registrar*/) +{ } //////////////////////////////////////////////////////////////////////////////// |
