Browse Source

Intermediate changes
commit_hash:f78c44da9f74c6e088ef2748a598d6ca3f65c517

robot-piglet 4 months ago
parent
commit
4d0b1eac3d

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

@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: hypothesis
-Version: 6.112.4
+Version: 6.112.5
 Summary: A library for property-based testing
 Home-page: https://hypothesis.works
 Author: David R. MacIver and Zac Hatfield-Dodds

+ 14 - 2
contrib/python/hypothesis/py3/hypothesis/stateful.py

@@ -501,9 +501,12 @@ class Bundle(SearchStrategy[Ex]):
     drawn from this bundle will be consumed (as above) when requested.
     """
 
-    def __init__(self, name: str, *, consume: bool = False) -> None:
+    def __init__(
+        self, name: str, *, consume: bool = False, draw_references: bool = True
+    ) -> None:
         self.name = name
         self.consume = consume
+        self.draw_references = draw_references
 
     def do_draw(self, data):
         machine = data.draw(self_strategy)
@@ -522,7 +525,9 @@ class Bundle(SearchStrategy[Ex]):
         else:
             reference = bundle[position]
 
-        return reference
+        if self.draw_references:
+            return reference
+        return machine.names_to_values[reference.name]
 
     def __repr__(self):
         consume = self.consume
@@ -541,6 +546,13 @@ class Bundle(SearchStrategy[Ex]):
         machine = data.draw(self_strategy)
         return bool(machine.bundle(self.name))
 
+    def flatmap(self, expand):
+        if self.draw_references:
+            return type(self)(
+                self.name, consume=self.consume, draw_references=False
+            ).flatmap(expand)
+        return super().flatmap(expand)
+
 
 def consumes(bundle: Bundle[Ex]) -> SearchStrategy[Ex]:
     """When introducing a rule in a RuleBasedStateMachine, this function can

+ 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, 112, 4)
+__version_info__ = (6, 112, 5)
 __version__ = ".".join(map(str, __version_info__))

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

@@ -2,7 +2,7 @@
 
 PY3_LIBRARY()
 
-VERSION(6.112.4)
+VERSION(6.112.5)
 
 LICENSE(MPL-2.0)