File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
pylint/testutils/functional Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change 55from __future__ import annotations
66
77import configparser
8- import os
98import sys
109from collections .abc import Callable
1110from os .path import basename , exists , join
11+ from pathlib import Path
1212from typing import TypedDict
1313
1414
@@ -101,18 +101,11 @@ def module(self) -> str:
101101
102102 @property
103103 def expected_output (self ) -> str :
104- files = list (
105- filter (
106- lambda s : s .startswith (f"{ self .base } ." ) and s .endswith (".txt" ),
107- os .listdir (self ._directory ),
108- )
109- )
104+ files = [p .stem for p in Path (self ._directory ).glob (f"{ self .base } .[0-9]*.txt" )]
110105 # pylint: disable-next=bad-builtin
111106 current_version = int ("" .join (map (str , sys .version_info [:2 ])))
112107 output_options = [
113- int (version )
114- for s in files
115- if s .count ("." ) == 2 and (version := s .rsplit ("." , maxsplit = 2 )[1 ]).isalnum ()
108+ int (version ) for s in files if (version := s .rpartition ("." )[2 ]).isalnum ()
116109 ]
117110 for opt in sorted (output_options , reverse = True ):
118111 if current_version >= opt :
You can’t perform that action at this time.
0 commit comments