Example #1
0
def test_is_eol_unknown(pyvinfo: CPythonVersionInfo, v: str) -> None:
    with pytest.raises(UnknownVersionError) as excinfo:
        pyvinfo.is_eol(v)
    assert str(excinfo.value) == f"Unknown version: {v!r}"
    assert excinfo.value.version == v
Example #2
0
def test_is_eol_recent(mocker: MockerFixture, pyvinfo: CPythonVersionInfo) -> None:
    mocker.patch("time.time", return_value=1635992101)
    assert pyvinfo.is_eol("2") is True
Example #3
0
def test_is_eol_invalid(pyvinfo: CPythonVersionInfo, v: str) -> None:
    with pytest.raises(ValueError) as excinfo:
        pyvinfo.is_eol(v)
    assert str(excinfo.value) == f"Invalid version string: {v!r}"
Example #4
0
def test_is_eol(pyvinfo: CPythonVersionInfo, version: str, is_eol: bool) -> None:
    assert pyvinfo.is_eol(version) is is_eol