File tree 1 file changed +3
-10
lines changed
pylint/testutils/functional
1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change 5
5
from __future__ import annotations
6
6
7
7
import configparser
8
- import os
9
8
import sys
10
9
from collections .abc import Callable
11
10
from os .path import basename , exists , join
11
+ from pathlib import Path
12
12
from typing import TypedDict
13
13
14
14
@@ -101,18 +101,11 @@ def module(self) -> str:
101
101
102
102
@property
103
103
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" )]
110
105
# pylint: disable-next=bad-builtin
111
106
current_version = int ("" .join (map (str , sys .version_info [:2 ])))
112
107
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 ()
116
109
]
117
110
for opt in sorted (output_options , reverse = True ):
118
111
if current_version >= opt :
You can’t perform that action at this time.
0 commit comments