summaryrefslogtreecommitdiff
path: root/src/_pytest/python.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/_pytest/python.py')
-rw-r--r--src/_pytest/python.py18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/_pytest/python.py b/src/_pytest/python.py
index 3d903ff9b..726241cb5 100644
--- a/src/_pytest/python.py
+++ b/src/_pytest/python.py
@@ -23,7 +23,6 @@ from typing import Optional
from typing import Sequence
from typing import Set
from typing import Tuple
-from typing import Type
from typing import TYPE_CHECKING
from typing import Union
@@ -254,20 +253,13 @@ def pytest_pycollect_makeitem(collector: "PyCollector", name: str, obj: object):
return res
-class PyobjMixin:
- _ALLOW_MARKERS = True
-
- # Function and attributes that the mixin needs (for type-checking only).
- if TYPE_CHECKING:
- name: str = ""
- parent: Optional[nodes.Node] = None
- own_markers: List[Mark] = []
+class PyobjMixin(nodes.Node):
+ """this mix-in inherits from Node to carry over the typing information
- def getparent(self, cls: Type[nodes._NodeType]) -> Optional[nodes._NodeType]:
- ...
+ as its intended to always mix in before a node
+ its position in the mro is unaffected"""
- def listchain(self) -> List[nodes.Node]:
- ...
+ _ALLOW_MARKERS = True
@property
def module(self):