예제 #1
0
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
예제 #2
0
def test_bad_step():
    with pytest.raises(ValueError):
        Range.from_range(range(10, 5, -2))