Exemple #1
0
def test_minor_versions(pyvinfo: CPythonVersionInfo) -> None:
    assert pyvinfo.minor_versions() == [
        "0.9",
        "1.0",
        "1.1",
        "1.2",
        "1.3",
        "1.4",
        "1.5",
        "1.6",
        "2.0",
        "2.1",
        "2.2",
        "2.3",
        "2.4",
        "2.5",
        "2.6",
        "2.7",
        "3.0",
        "3.1",
        "3.2",
        "3.3",
        "3.4",
        "3.5",
        "3.6",
        "3.7",
        "3.8",
        "4.0",
    ]
Exemple #2
0
def test_subversions_unknown(pyvinfo: CPythonVersionInfo, v: str) -> None:
    with pytest.raises(UnknownVersionError) as excinfo:
        pyvinfo.subversions(v)
    assert str(excinfo.value) == f"Unknown version: {v!r}"
    assert excinfo.value.version == v
Exemple #3
0
def test_subversions_invalid_micro(pyvinfo: CPythonVersionInfo, v: str) -> None:
    with pytest.raises(ValueError) as excinfo:
        pyvinfo.subversions(v)
    assert str(excinfo.value) == f"Micro versions do not have subversions: {v!r}"
Exemple #4
0
def test_subversions_invalid(pyvinfo: CPythonVersionInfo, v: str) -> None:
    with pytest.raises(ValueError) as excinfo:
        pyvinfo.subversions(v)
    assert str(excinfo.value) == f"Invalid version string: {v!r}"
Exemple #5
0
def test_subversions(pyvinfo: CPythonVersionInfo, v: str, subs: List[str]) -> None:
    assert pyvinfo.subversions(v) == subs
Exemple #6
0
def test_is_supported(
    pyvinfo: CPythonVersionInfo, series: str, is_supported: bool
) -> None:
    assert pyvinfo.is_supported(series) is is_supported
Exemple #7
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
Exemple #8
0
def test_is_eol(pyvinfo: CPythonVersionInfo, version: str, is_eol: bool) -> None:
    assert pyvinfo.is_eol(version) is is_eol
Exemple #9
0
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)
Exemple #10
0
def test_eol_date(
    pyvinfo: CPythonVersionInfo, version: str, eol: Optional[date]
) -> None:
    assert pyvinfo.eol_date(version) == eol
Exemple #11
0
def test_micro_versions(pyvinfo: CPythonVersionInfo) -> None:
    assert pyvinfo.micro_versions() == [
        "0.9.0",
        "0.9.1",
        "0.9.2",
        "0.9.4",
        "0.9.5",
        "0.9.6",
        "0.9.8",
        "0.9.9",
        "1.0.0",
        "1.0.1",
        "1.0.2",
        "1.0.3",
        "1.0.4",
        "1.1.0",
        "1.1.1",
        "1.2.0",
        "1.3.0",
        "1.4.0",
        "1.5.0",
        "1.5.1",
        "1.5.2",
        "1.6.0",
        "1.6.1",
        "2.0.0",
        "2.0.1",
        "2.1.0",
        "2.1.1",
        "2.1.2",
        "2.1.3",
        "2.2.0",
        "2.2.1",
        "2.2.2",
        "2.2.3",
        "2.3.0",
        "2.3.1",
        "2.3.2",
        "2.3.3",
        "2.3.4",
        "2.3.5",
        "2.3.6",
        "2.3.7",
        "2.4.0",
        "2.4.1",
        "2.4.2",
        "2.4.3",
        "2.4.4",
        "2.4.5",
        "2.4.6",
        "2.5.0",
        "2.5.1",
        "2.5.2",
        "2.5.3",
        "2.5.4",
        "2.5.5",
        "2.5.6",
        "2.6.0",
        "2.6.1",
        "2.6.2",
        "2.6.3",
        "2.6.4",
        "2.6.5",
        "2.6.6",
        "2.6.7",
        "2.6.8",
        "2.6.9",
        "2.7.0",
        "2.7.1",
        "2.7.2",
        "2.7.3",
        "2.7.4",
        "2.7.5",
        "2.7.6",
        "2.7.7",
        "2.7.8",
        "2.7.9",
        "2.7.10",
        "2.7.11",
        "2.7.12",
        "2.7.13",
        "2.7.14",
        "2.7.15",
        "2.7.16",
        "2.7.17",
        "2.7.18",
        "3.0.0",
        "3.0.1",
        "3.1.0",
        "3.1.1",
        "3.1.2",
        "3.1.3",
        "3.1.4",
        "3.1.5",
        "3.2.0",
        "3.2.1",
        "3.2.2",
        "3.2.3",
        "3.2.4",
        "3.2.5",
        "3.2.6",
        "3.3.0",
        "3.3.1",
        "3.3.2",
        "3.3.3",
        "3.3.4",
        "3.3.5",
        "3.3.6",
        "3.3.7",
        "3.4.0",
        "3.4.1",
        "3.4.2",
        "3.4.3",
        "3.4.4",
        "3.4.5",
        "3.4.6",
        "3.4.7",
        "3.4.8",
        "3.4.9",
        "3.4.10",
        "3.5.0",
        "3.5.1",
        "3.5.2",
        "3.5.3",
        "3.5.4",
        "3.5.5",
        "3.5.6",
        "3.5.7",
        "3.6.0",
        "3.6.1",
        "3.6.2",
        "3.6.3",
        "3.6.4",
        "3.6.5",
        "3.6.6",
        "3.6.7",
        "3.6.8",
        "3.7.0",
        "3.7.1",
        "3.7.2",
        "3.7.3",
        "3.7.4",
        "3.8.0",
        "4.0.0",
    ]
Exemple #12
0
def test_is_released(pyvinfo: CPythonVersionInfo, v: str, rel: bool) -> None:
    assert pyvinfo.is_released(v) is rel
Exemple #13
0
def test_release_date(pyvinfo: CPythonVersionInfo, v: str, rel: Optional[date]) -> None:
    assert pyvinfo.release_date(v) == rel
Exemple #14
0
def test_major_versions(pyvinfo: CPythonVersionInfo) -> None:
    assert pyvinfo.major_versions() == ["0", "1", "2", "3", "4"]
Exemple #15
0
def test_supported_series(pyvinfo: CPythonVersionInfo) -> None:
    assert pyvinfo.supported_series() == ["2.7", "3.5", "3.6", "3.7"]