Просмотр исходного кода

fix bank-applications: remove bank-forms usage

ivasenkov15 1 год назад
Родитель
Сommit
4f5160da6a

+ 3 - 3
contrib/python/hypothesis/py3/.dist-info/METADATA

@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: hypothesis
-Version: 6.92.2
+Version: 6.92.6
 Summary: A library for property-based testing
 Home-page: https://hypothesis.works
 Author: David R. MacIver and Zac Hatfield-Dodds
@@ -53,7 +53,7 @@ Requires-Dist: pytz >=2014.1 ; extra == 'all'
 Requires-Dist: redis >=3.0.0 ; extra == 'all'
 Requires-Dist: rich >=9.0.0 ; extra == 'all'
 Requires-Dist: backports.zoneinfo >=0.2.1 ; (python_version < "3.9") and extra == 'all'
-Requires-Dist: tzdata >=2023.3 ; (sys_platform == "win32") and extra == 'all'
+Requires-Dist: tzdata >=2023.4 ; (sys_platform == "win32") and extra == 'all'
 Provides-Extra: cli
 Requires-Dist: click >=7.0 ; extra == 'cli'
 Requires-Dist: black >=19.10b0 ; extra == 'cli'
@@ -82,7 +82,7 @@ Provides-Extra: redis
 Requires-Dist: redis >=3.0.0 ; extra == 'redis'
 Provides-Extra: zoneinfo
 Requires-Dist: backports.zoneinfo >=0.2.1 ; (python_version < "3.9") and extra == 'zoneinfo'
-Requires-Dist: tzdata >=2023.3 ; (sys_platform == "win32") and extra == 'zoneinfo'
+Requires-Dist: tzdata >=2023.4 ; (sys_platform == "win32") and extra == 'zoneinfo'
 
 ==========
 Hypothesis

+ 14 - 3
contrib/python/hypothesis/py3/hypothesis/core.py

@@ -88,6 +88,7 @@ from hypothesis.internal.escalation import (
 )
 from hypothesis.internal.healthcheck import fail_health_check
 from hypothesis.internal.observability import (
+    OBSERVABILITY_COLLECT_COVERAGE,
     TESTCASE_CALLBACKS,
     deliver_json_blob,
     make_testcase,
@@ -916,7 +917,18 @@ class StateForActualGivenExecution:
                     **dict(enumerate(map(to_jsonable, args))),
                     **{k: to_jsonable(v) for k, v in kwargs.items()},
                 }
-            return test(*args, **kwargs)
+
+            try:
+                return test(*args, **kwargs)
+            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
+                raise
 
         # self.test_runner can include the execute_example method, or setup/teardown
         # _example, so it's important to get the PRNG and build context in place first.
@@ -968,7 +980,7 @@ class StateForActualGivenExecution:
             _can_trace = (
                 sys.gettrace() is None or sys.version_info[:2] >= (3, 12)
             ) and not PYPY
-            _trace_obs = TESTCASE_CALLBACKS
+            _trace_obs = TESTCASE_CALLBACKS and OBSERVABILITY_COLLECT_COVERAGE
             _trace_failure = (
                 self.failed_normally
                 and not self.failed_due_to_deadline
@@ -1023,7 +1035,6 @@ class StateForActualGivenExecution:
                 # The test failed by raising an exception, so we inform the
                 # engine that this test run was interesting. This is the normal
                 # path for test runs that fail.
-
                 tb = get_trimmed_traceback()
                 info = data.extra_information
                 info._expected_traceback = format_exception(e, tb)  # type: ignore

+ 21 - 2
contrib/python/hypothesis/py3/hypothesis/internal/observability.py

@@ -12,10 +12,13 @@
 
 import json
 import os
+import sys
+import warnings
 from datetime import date, timedelta
 from typing import Callable, Dict, List, Optional
 
 from hypothesis.configuration import storage_directory
+from hypothesis.errors import HypothesisWarning
 from hypothesis.internal.conjecture.data import ConjectureData, Status
 
 TESTCASE_CALLBACKS: List[Callable[[dict], None]] = []
@@ -76,13 +79,29 @@ _WROTE_TO = set()
 def _deliver_to_file(value):  # pragma: no cover
     kind = "testcases" if value["type"] == "test_case" else "info"
     fname = storage_directory("observed", f"{date.today().isoformat()}_{kind}.jsonl")
-    fname.parent.mkdir(exist_ok=True)
+    fname.parent.mkdir(exist_ok=True, parents=True)
     _WROTE_TO.add(fname)
     with fname.open(mode="a") as f:
         f.write(json.dumps(value) + "\n")
 
 
-if "HYPOTHESIS_EXPERIMENTAL_OBSERVABILITY" in os.environ:  # pragma: no cover
+OBSERVABILITY_COLLECT_COVERAGE = (
+    "HYPOTHESIS_EXPERIMENTAL_OBSERVABILITY_NOCOVER" not in os.environ
+)
+if OBSERVABILITY_COLLECT_COVERAGE is False and sys.version_info[:2] >= (
+    3,
+    12,
+):  # pragma: no cover
+    warnings.warn(
+        "Coverage data collection should be quite fast in Python 3.12 or later "
+        "so there should be no need to turn coverage reporting off.",
+        HypothesisWarning,
+        stacklevel=2,
+    )
+if (
+    "HYPOTHESIS_EXPERIMENTAL_OBSERVABILITY" in os.environ
+    or OBSERVABILITY_COLLECT_COVERAGE is False
+):  # pragma: no cover
     TESTCASE_CALLBACKS.append(_deliver_to_file)
 
     # Remove files more than a week old, to cap the size on disk

+ 1 - 1
contrib/python/hypothesis/py3/hypothesis/strategies/_internal/core.py

@@ -1438,7 +1438,7 @@ def _from_type(thing: Type[Ex]) -> SearchStrategy[Ex]:
                 kwargs[k] = from_type_guarded(hints[k])
                 if p.default is not Parameter.empty and kwargs[k] is not ...:
                     kwargs[k] = just(p.default) | kwargs[k]
-        if params and not kwargs:
+        if params and not kwargs and not issubclass(thing, BaseException):
             from_type_repr = repr_call(from_type, (thing,), {})
             builds_repr = repr_call(builds, (thing,), {})
             warnings.warn(

+ 16 - 0
contrib/python/hypothesis/py3/hypothesis/strategies/_internal/strategies.py

@@ -528,6 +528,22 @@ class SampledFromStrategy(SearchStrategy):
 
     def do_draw(self, data):
         result = self.do_filtered_draw(data)
+        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?"
+            )
         if result is filter_not_satisfied:
             data.mark_invalid(f"Aborted test because unable to satisfy {self!r}")
         return result

+ 3 - 2
contrib/python/hypothesis/py3/hypothesis/strategies/_internal/types.py

@@ -625,17 +625,18 @@ _global_type_lookup: typing.Dict[
     BaseExceptionGroup: st.builds(
         BaseExceptionGroup,
         st.text(),
-        st.lists(st.from_type(BaseException), min_size=1),
+        st.lists(st.from_type(BaseException), min_size=1, max_size=5),
     ),
     ExceptionGroup: st.builds(
         ExceptionGroup,
         st.text(),
-        st.lists(st.from_type(Exception), min_size=1),
+        st.lists(st.from_type(Exception), min_size=1, max_size=5),
     ),
     enumerate: st.builds(enumerate, st.just(())),
     filter: st.builds(filter, st.just(lambda _: None), st.just(())),
     map: st.builds(map, st.just(lambda _: None), st.just(())),
     reversed: st.builds(reversed, st.just(())),
+    zip: st.builds(zip),  # avoids warnings on PyPy 7.3.14+
     property: st.builds(property, st.just(lambda _: None)),
     classmethod: st.builds(classmethod, st.just(lambda self: self)),
     staticmethod: st.builds(staticmethod, st.just(lambda self: self)),

+ 1 - 1
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, 92, 2)
+__version_info__ = (6, 92, 6)
 __version__ = ".".join(map(str, __version_info__))

+ 1 - 1
contrib/python/hypothesis/py3/ya.make

@@ -2,7 +2,7 @@
 
 PY3_LIBRARY()
 
-VERSION(6.92.2)
+VERSION(6.92.6)
 
 LICENSE(MPL-2.0)
 

+ 1 - 1
contrib/python/ipython/py3/.dist-info/METADATA

@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: ipython
-Version: 8.19.0
+Version: 8.20.0
 Summary: IPython: Productive Interactive Computing
 Home-page: https://ipython.org
 Author: The IPython Development Team

+ 1 - 1
contrib/python/ipython/py3/IPython/core/debugger.py

@@ -454,7 +454,7 @@ class Pdb(OldPdb):
                 with self._hold_exceptions(_chained_exceptions):
                     OldPdb.interaction(self, frame, tb)
             else:
-                OldPdb.interaction(self, frame, traceback)
+                OldPdb.interaction(self, frame, tb_or_exc)
 
         except KeyboardInterrupt:
             self.stdout.write("\n" + self.shell.get_exception_only())

Некоторые файлы не были показаны из-за большого количества измененных файлов