summaryrefslogtreecommitdiffstats
path: root/contrib/python/hypothesis
diff options
context:
space:
mode:
authorrobot-piglet <[email protected]>2024-01-26 13:18:00 +0300
committerrobot-piglet <[email protected]>2024-01-26 14:37:14 +0300
commit7e48de06a66dff1e3f73e186f64b6d155dffa086 (patch)
treeedd6494ecf7cfca5285dbf4e5c386a20ab58e970 /contrib/python/hypothesis
parent9b8da54607431b12327615568180adf77cca95c8 (diff)
Intermediate changes
Diffstat (limited to 'contrib/python/hypothesis')
-rw-r--r--contrib/python/hypothesis/py3/.dist-info/METADATA2
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/control.py11
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/core.py4
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/errors.py3
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/version.py2
-rw-r--r--contrib/python/hypothesis/py3/ya.make2
6 files changed, 17 insertions, 7 deletions
diff --git a/contrib/python/hypothesis/py3/.dist-info/METADATA b/contrib/python/hypothesis/py3/.dist-info/METADATA
index bf3a10e9cc8..b4f00cf430d 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.92.7
+Version: 6.92.8
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 c49dba2954a..3a973f666f9 100644
--- a/contrib/python/hypothesis/py3/hypothesis/control.py
+++ b/contrib/python/hypothesis/py3/hypothesis/control.py
@@ -8,6 +8,7 @@
# 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/.
+import inspect
import math
from collections import defaultdict
from typing import NoReturn, Union
@@ -25,6 +26,10 @@ from hypothesis.utils.dynamicvariables import DynamicVariable
from hypothesis.vendor.pretty import IDKey
+def _calling_function_name(frame):
+ return frame.f_back.f_code.co_name
+
+
def reject() -> NoReturn:
if _current_build_context.value is None:
note_deprecation(
@@ -32,7 +37,8 @@ def reject() -> NoReturn:
since="2023-09-25",
has_codemod=False,
)
- raise UnsatisfiedAssumption
+ f = _calling_function_name(inspect.currentframe())
+ raise UnsatisfiedAssumption(f"reject() in {f}")
def assume(condition: object) -> bool:
@@ -49,7 +55,8 @@ def assume(condition: object) -> bool:
has_codemod=False,
)
if not condition:
- raise UnsatisfiedAssumption
+ f = _calling_function_name(inspect.currentframe())
+ raise UnsatisfiedAssumption(f"failed to satisfy assume() in {f}")
return True
diff --git a/contrib/python/hypothesis/py3/hypothesis/core.py b/contrib/python/hypothesis/py3/hypothesis/core.py
index 7c149d12220..86b20ea6f98 100644
--- a/contrib/python/hypothesis/py3/hypothesis/core.py
+++ b/contrib/python/hypothesis/py3/hypothesis/core.py
@@ -1005,10 +1005,10 @@ class StateForActualGivenExecution:
f"{self.test.__name__} returned {result!r} instead.",
HealthCheck.return_value,
)
- except UnsatisfiedAssumption:
+ except UnsatisfiedAssumption as e:
# An "assume" check failed, so instead we inform the engine that
# this test run was invalid.
- data.mark_invalid()
+ data.mark_invalid(e.reason)
except StopTest:
# The engine knows how to handle this control exception, so it's
# OK to re-raise it.
diff --git a/contrib/python/hypothesis/py3/hypothesis/errors.py b/contrib/python/hypothesis/py3/hypothesis/errors.py
index 9ee81cfc36f..8387a875863 100644
--- a/contrib/python/hypothesis/py3/hypothesis/errors.py
+++ b/contrib/python/hypothesis/py3/hypothesis/errors.py
@@ -23,6 +23,9 @@ class UnsatisfiedAssumption(HypothesisException):
If you're seeing this error something has gone wrong.
"""
+ def __init__(self, reason=None):
+ self.reason = reason
+
class NoSuchExample(HypothesisException):
"""The condition we have been asked to satisfy appears to be always false.
diff --git a/contrib/python/hypothesis/py3/hypothesis/version.py b/contrib/python/hypothesis/py3/hypothesis/version.py
index cd924cc7a7f..ef8fe6a63a3 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, 92, 7)
+__version_info__ = (6, 92, 8)
__version__ = ".".join(map(str, __version_info__))
diff --git a/contrib/python/hypothesis/py3/ya.make b/contrib/python/hypothesis/py3/ya.make
index 6616c6d3b9e..92b1d0c734e 100644
--- a/contrib/python/hypothesis/py3/ya.make
+++ b/contrib/python/hypothesis/py3/ya.make
@@ -2,7 +2,7 @@
PY3_LIBRARY()
-VERSION(6.92.7)
+VERSION(6.92.8)
LICENSE(MPL-2.0)