def test_conversions() -> None: 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() -> None: with pytest.raises(ValueError): Range.from_range(range(10, 5, -2))