File tree Expand file tree Collapse file tree
hypothesis-python/src/hypothesis/internal/conjecture Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313from hypothesis .internal .compat import int_from_bytes , int_to_bytes
1414from hypothesis .internal .conjecture .data import (
1515 ConjectureResult ,
16+ IRType ,
1617 Status ,
1718 _Overrun ,
1819 bits_to_bytes ,
@@ -134,12 +135,16 @@ def attempt_replace(k: int) -> bool:
134135 return False
135136
136137 node = self .current_data .examples .ir_tree_nodes [i ]
138+ assert node .index is not None
137139 if node .was_forced :
138140 return False # pragma: no cover
139141
142+ new_value : IRType
140143 if node .ir_type in {"integer" , "float" }:
144+ assert isinstance (node .value , (int , float ))
141145 new_value = node .value + k
142146 elif node .ir_type == "boolean" :
147+ assert isinstance (node .value , bool )
143148 if abs (k ) > 1 :
144149 return False
145150 if k == - 1 :
@@ -150,6 +155,7 @@ def attempt_replace(k: int) -> bool:
150155 new_value = node .value
151156 else :
152157 assert node .ir_type == "bytes"
158+ assert isinstance (node .value , bytes )
153159 v = int_from_bytes (node .value )
154160 # can't go below zero for bytes
155161 if v + k < 0 :
You can’t perform that action at this time.
0 commit comments