python: don't redundantly duplicate parent markers to own keywords
This does have a slight semantic change: in a node hierarchy parent -> child, if parent has a marker applied, then child is constructed, then `parent.themarker = "overridden"`, previously `child.keywords['themarker']` would return `True`, now it returns `"overridden"`. But that's actually what I would have expected so I see it as more of a bugfix.
This commit is contained in:
parent
8713c32462
commit
d9bcfa0c2b
|
@ -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
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue