Skip to content

Commit a43cbb8

Browse files
authored
Add 3.13 to the version list so stdlib_list("3.13") works. (#139)
1 parent 012e3b5 commit a43cbb8

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

stdlib_list/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"3.10",
2020
"3.11",
2121
"3.12",
22+
"3.13",
2223
]
2324

2425
short_versions = [".".join(x.split(".")[:2]) for x in long_versions]

tests/test_base.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import pkgutil
1+
from importlib import resources
22

33
import pytest
44

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

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

3030
assert modules == stdlib_list.stdlib_list(version)
31+
32+
33+
@pytest.mark.parametrize(
34+
"version_file", [f.name for f in resources.files("stdlib_list").joinpath("lists").iterdir()]
35+
)
36+
def test_self_consistent_reverse(version_file):
37+
version = version_file.removesuffix(".txt")
38+
assert stdlib_list.stdlib_list(version)

0 commit comments

Comments
 (0)