File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 19
19
"3.10" ,
20
20
"3.11" ,
21
21
"3.12" ,
22
+ "3.13" ,
22
23
]
23
24
24
25
short_versions = ["." .join (x .split ("." )[:2 ]) for x in long_versions ]
Original file line number Diff line number Diff line change 1
- import pkgutil
1
+ from importlib import resources
2
2
3
3
import pytest
4
4
@@ -22,9 +22,17 @@ def test_get_canonical_version_raises(version):
22
22
@pytest .mark .parametrize ("version" , [* stdlib_list .short_versions , * stdlib_list .long_versions ])
23
23
def test_self_consistent (version ):
24
24
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 ()
26
26
27
27
for mod_name in modules :
28
28
assert stdlib_list .in_stdlib (mod_name , version )
29
29
30
30
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 )
You can’t perform that action at this time.
0 commit comments