diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 71c998c8e..60b2ae20f 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -1676,10 +1676,11 @@ class Function(PyobjMixin, nodes.Item): # todo: this is a hell of a hack # https://github.com/pytest-dev/pytest/issues/4569 + # Take own_markers only; NodeKeywords handles parent traversal on its own. self.keywords.update( { mark.name: mark - for mark in self.iter_markers() + for mark in self.own_markers if mark.name not in self.keywords } )