From 3c69bc919c1cc5c45f52b90ef1ebdd136952d577 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Wed, 6 Oct 2021 22:59:34 +0300 Subject: [PATCH] python: remove broken/ineffectual keywords marks initialization By my analysis, this deleted code block has no effect: 1. `self.keywords` is `update`d with `callspec.marks`. 2. `self.own_markers` is `update`d with `callspec.marks`. 3. `self.keywords` is `update`d with `self.own_markers`. So together steps 2+3 completely undo step 1. --- src/_pytest/python.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 60b2ae20f..63701a535 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -1662,13 +1662,6 @@ class Function(PyobjMixin, nodes.Item): self.own_markers.extend(get_unpacked_marks(self.obj)) if callspec: self.callspec = callspec - # this is total hostile and a mess - # keywords are broken by design by now - # this will be redeemed later - for mark in callspec.marks: - # feel free to cry, this was broken for years before - # and keywords can't fix it per design - self.keywords[mark.name] = mark self.own_markers.extend(callspec.marks) if keywords: self.keywords.update(keywords)