Skip to content

Commit 5dca7a2

Browse files
committed
Fix check_untyped_defs errors in cacheprovider
1 parent 93c8822 commit 5dca7a2

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/_pytest/cacheprovider.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import json
88
import os
99
from collections import OrderedDict
10+
from typing import List
1011

1112
import attr
1213
import py
@@ -15,6 +16,9 @@
1516
from .pathlib import Path
1617
from .pathlib import resolve_from_str
1718
from .pathlib import rm_rf
19+
from _pytest import nodes
20+
from _pytest.config import Config
21+
from _pytest.main import Session
1822

1923
README_CONTENT = """\
2024
# pytest cache directory #
@@ -263,10 +267,12 @@ def __init__(self, config):
263267
self.active = config.option.newfirst
264268
self.cached_nodeids = config.cache.get("cache/nodeids", [])
265269

266-
def pytest_collection_modifyitems(self, session, config, items):
270+
def pytest_collection_modifyitems(
271+
self, session: Session, config: Config, items: List[nodes.Item]
272+
) -> None:
267273
if self.active:
268-
new_items = OrderedDict()
269-
other_items = OrderedDict()
274+
new_items = OrderedDict() # type: OrderedDict[str, nodes.Item]
275+
other_items = OrderedDict() # type: OrderedDict[str, nodes.Item]
270276
for item in items:
271277
if item.nodeid not in self.cached_nodeids:
272278
new_items[item.nodeid] = item

0 commit comments

Comments
 (0)