def test_subtraction_of_intervals(x, y): xs = intervals_to_set(x) ys = intervals_to_set(x) assume(not xs.isdisjoint(ys)) z = _subtract_intervals(x, y) assert z == tuple(sorted(z)) for a, b in z: assert a <= b assert intervals_to_set(z) == intervals_to_set(x) - intervals_to_set(y)