Skip to content

Commit

Permalink
Add 3.13 to the version list so stdlib_list("3.13") works. (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
yilei authored Dec 20, 2024
1 parent 012e3b5 commit a43cbb8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions stdlib_list/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"3.10",
"3.11",
"3.12",
"3.13",
]

short_versions = [".".join(x.split(".")[:2]) for x in long_versions]
Expand Down
12 changes: 10 additions & 2 deletions tests/test_base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pkgutil
from importlib import resources

import pytest

Expand All @@ -22,9 +22,17 @@ def test_get_canonical_version_raises(version):
@pytest.mark.parametrize("version", [*stdlib_list.short_versions, *stdlib_list.long_versions])
def test_self_consistent(version):
list_path = f"lists/{stdlib_list.get_canonical_version(version)}.txt"
modules = pkgutil.get_data("stdlib_list", list_path).decode().splitlines()
modules = resources.files("stdlib_list").joinpath(list_path).read_text().splitlines()

for mod_name in modules:
assert stdlib_list.in_stdlib(mod_name, version)

assert modules == stdlib_list.stdlib_list(version)


@pytest.mark.parametrize(
"version_file", [f.name for f in resources.files("stdlib_list").joinpath("lists").iterdir()]
)
def test_self_consistent_reverse(version_file):
version = version_file.removesuffix(".txt")
assert stdlib_list.stdlib_list(version)

0 comments on commit a43cbb8

Please sign in to comment.