Relative Content

Tag Archive for pythonassert

What does this code mean: “assert result == repeat, (result, repeat)”? [duplicate]

This question already has answers here: What is the use of “assert” in Python? (23 answers) Closed 3 months ago. From here: from hypothesis import given, strategies as st @given(seq=st.one_of(st.binary(), st.binary().map(bytearray), st.lists(st.integers()))) def test_idempotent_timsort(seq): result = timsort(seq=seq) repeat = timsort(seq=result) assert result == repeat, (result, repeat) What does the last assert mean? I understand result […]

What does this code mean: “assert result == repeat, (result, repeat)”? [duplicate]

This question already has answers here: What is the use of “assert” in Python? (23 answers) Closed 3 months ago. From here: from hypothesis import given, strategies as st @given(seq=st.one_of(st.binary(), st.binary().map(bytearray), st.lists(st.integers()))) def test_idempotent_timsort(seq): result = timsort(seq=seq) repeat = timsort(seq=result) assert result == repeat, (result, repeat) What does the last assert mean? I understand result […]

What does this code mean: “assert result == repeat, (result, repeat)”? [duplicate]

This question already has answers here: What is the use of “assert” in Python? (23 answers) Closed 3 months ago. From here: from hypothesis import given, strategies as st @given(seq=st.one_of(st.binary(), st.binary().map(bytearray), st.lists(st.integers()))) def test_idempotent_timsort(seq): result = timsort(seq=seq) repeat = timsort(seq=result) assert result == repeat, (result, repeat) What does the last assert mean? I understand result […]