From 302345db27fa1f97241b6e0226e4bdae70b96beb Mon Sep 17 00:00:00 2001 From: Oren Efraimov Date: Sun, 19 Sep 2021 19:14:13 +0300 Subject: [PATCH] Fixing missing marks when inheritance from multiple classes Closes https://github.com/pytest-dev/pytest/issues/7792 --- src/_pytest/python.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index e44320ddf49..20af742da2d 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -1587,6 +1587,8 @@ def __init__( self.keywords.update(self.obj.__dict__) self.own_markers.extend(get_unpacked_marks(self.obj)) + self.own_markers.extend( + {str(mark): mark for parent_obj in self.cls.__mro__ for mark in get_unpacked_marks(parent_obj)}.values()) if callspec: self.callspec = callspec # this is total hostile and a mess