Skip to content

Commit 6a981fc

Browse files
committed
refactor slightly
1 parent 25dbf2d commit 6a981fc

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

hypothesis-python/src/hypothesis/internal/conjecture/shrinker.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -973,9 +973,8 @@ def __changed_nodes(self):
973973
assert len(prev_nodes) == len(new_nodes)
974974
for i, (n1, n2) in enumerate(zip(prev_nodes, new_nodes)):
975975
assert n1.ir_type == n2.ir_type
976-
if ir_value_equal(n1.ir_type, n1.value, n2.value):
977-
continue
978-
self.__all_changed_nodes.add(i)
976+
if not ir_value_equal(n1.ir_type, n1.value, n2.value):
977+
self.__all_changed_nodes.add(i)
979978

980979
return self.__all_changed_nodes
981980

hypothesis-python/tests/conjecture/test_ir.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,11 @@ def test_node_with_same_ir_type_but_different_value_is_invalid(data):
404404
assert data.status is Status.INVALID
405405

406406

407-
@given(st.data())
408-
def test_data_with_changed_was_forced(data):
407+
@given(ir_nodes(was_forced=False))
408+
def test_data_with_changed_was_forced(node):
409409
# we had a normal node and then tried to draw a different forced value from it.
410410
# ir tree: v1 [was_forced=False]
411411
# drawing: [forced=v2]
412-
node = data.draw(ir_nodes(was_forced=False))
413412
data = ConjectureData.for_ir_tree([node])
414413

415414
draw_func = getattr(data, f"draw_{node.ir_type}")

0 commit comments

Comments
 (0)