def test_conversions(): t = range(10, 1, -1) r = Range.from_range(t) assert r.left == 10 assert r.right == 2 assert r.direction == "downto" assert r.to_range() == t
def test_bad_step(): with pytest.raises(ValueError): Range.from_range(range(10, 5, -2))