示例#1
0
def test_version():
    assert isinstance(__version__, str)
    major, minor, is_unstable = _parse_version(__version__)
    assert isinstance(major, int)
    assert isinstance(minor, int)
    assert isinstance(is_unstable, bool)
示例#2
0
def test_version_parser(version: str, expected: Tuple[int, int, int]):
    assert _parse_version(version) == expected
示例#3
0
def test_version_with_error():
    with pytest.raises(ValueError):
        _parse_version("not_a_version")
示例#4
0
def test_version():
    assert isinstance(__version__, str)
    versions: (int, int, int) = _parse_version(__version__)
    for v in versions:
        assert isinstance(v, int)