summaryrefslogtreecommitdiff
path: root/src/_pytest/nodes.py
diff options
context:
space:
mode:
authorRan Benita <ran@unusedvar.com>2020-08-01 13:06:13 +0300
committerRan Benita <ran@unusedvar.com>2020-08-01 20:39:15 +0300
commitbe656dd4e4444acd9600660fc3b6bf3896067dbe (patch)
treeea7998a38648f2397a818ad8f9948d2048e3b631 /src/_pytest/nodes.py
parent49827adcb9256c9c9c06a25729421dcc3c385edc (diff)
downloadpytest-be656dd4e4444acd9600660fc3b6bf3896067dbe.tar.gz
typing: set disallow_any_generics
This prevents referring to a generic type without filling in its generic type parameters. The FixtureDef typing might need some more refining in the future.
Diffstat (limited to 'src/_pytest/nodes.py')
-rw-r--r--src/_pytest/nodes.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/_pytest/nodes.py b/src/_pytest/nodes.py
index cc1cc7ebd..9522f4184 100644
--- a/src/_pytest/nodes.py
+++ b/src/_pytest/nodes.py
@@ -1,6 +1,7 @@
import os
import warnings
from functools import lru_cache
+from typing import Any
from typing import Callable
from typing import Dict
from typing import Iterable
@@ -167,7 +168,7 @@ class Node(metaclass=NodeMeta):
self.extra_keyword_matches = set() # type: Set[str]
# Used for storing artificial fixturedefs for direct parametrization.
- self._name2pseudofixturedef = {} # type: Dict[str, FixtureDef]
+ self._name2pseudofixturedef = {} # type: Dict[str, FixtureDef[Any]]
if nodeid is not None:
assert "::()" not in nodeid
@@ -354,7 +355,7 @@ class Node(metaclass=NodeMeta):
assert current is None or isinstance(current, cls)
return current
- def _prunetraceback(self, excinfo):
+ def _prunetraceback(self, excinfo: ExceptionInfo[BaseException]) -> None:
pass
def _repr_failure_py(
@@ -479,7 +480,7 @@ class Collector(Node):
return self._repr_failure_py(excinfo, style=tbstyle)
- def _prunetraceback(self, excinfo):
+ def _prunetraceback(self, excinfo: ExceptionInfo[BaseException]) -> None:
if hasattr(self, "fspath"):
traceback = excinfo.traceback
ntraceback = traceback.cut(path=self.fspath)