# Pastebin UsDJzdeg from hypothesis import given from hypothesis import strategies as st def apply(m, ops): for k, v, delete in ops: if delete and k in m: del m[k] continue m[k] = v @given(st.lists(st.tuples(st.text(), st.text(), st.booleans()))) def test_dicts_insert_the_same(ops): a = {} b = {} apply(a, ops) apply(b, ops) assert list(a.keys()) == list(b.keys()) test_dicts_insert_the_same()