File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 6
6
import dataclasses
7
7
from typing import AbstractSet
8
8
from typing import Collection
9
+ from typing import Iterable
9
10
from typing import Optional
10
11
from typing import TYPE_CHECKING
11
12
@@ -227,9 +228,9 @@ class MarkMatcher:
227
228
own_mark_name_mapping : dict [str , list [Mark ]]
228
229
229
230
@classmethod
230
- def from_item (cls , item : Item ) -> MarkMatcher :
231
+ def from_markers (cls , markers : Iterable [ Mark ] ) -> MarkMatcher :
231
232
mark_name_mapping = collections .defaultdict (list )
232
- for mark in item . iter_markers () :
233
+ for mark in markers :
233
234
mark_name_mapping [mark .name ].append (mark )
234
235
return cls (mark_name_mapping )
235
236
@@ -256,7 +257,7 @@ def deselect_by_mark(items: list[Item], config: Config) -> None:
256
257
remaining : list [Item ] = []
257
258
deselected : list [Item ] = []
258
259
for item in items :
259
- if expr .evaluate (MarkMatcher .from_item (item )):
260
+ if expr .evaluate (MarkMatcher .from_markers (item . iter_markers () )):
260
261
remaining .append (item )
261
262
else :
262
263
deselected .append (item )
You can’t perform that action at this time.
0 commit comments