def test_eol_date_unknown(pyvinfo: CPythonVersionInfo, v: str) -> None: with pytest.raises(UnknownVersionError) as excinfo: pyvinfo.eol_date(v) assert str(excinfo.value) == f"Unknown version: {v!r}" assert excinfo.value.version == v
def test_eol_date_recent(mocker: MockerFixture, pyvinfo: CPythonVersionInfo) -> None: mocker.patch("time.time", return_value=1635992101) assert pyvinfo.eol_date("2") == date(2020, 1, 1)
def test_eol_date_invalid(pyvinfo: CPythonVersionInfo, v: str) -> None: with pytest.raises(ValueError) as excinfo: pyvinfo.eol_date(v) assert str(excinfo.value) == f"Invalid version string: {v!r}"
def test_eol_date( pyvinfo: CPythonVersionInfo, version: str, eol: Optional[date] ) -> None: assert pyvinfo.eol_date(version) == eol