From 60906f7a46863416b67d329d45e39bcb01d5a28c Mon Sep 17 00:00:00 2001 From: Wouter van Ackooy Date: Mon, 27 May 2013 17:58:39 +0200 Subject: [PATCH] Issue 306: Use the names of all the parents in the chain for matching, except the Instance objects. --- _pytest/mark.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_pytest/mark.py b/_pytest/mark.py index 5f3d880d5..67ff92817 100644 --- a/_pytest/mark.py +++ b/_pytest/mark.py @@ -130,7 +130,7 @@ def matchkeyword(colitem, keywordexpr): # Add the names of the current item and any parent items for item in colitem.listchain(): - if isinstance(item, pytest.Class) or isinstance(item, pytest.Function): + if not isinstance(item, pytest.Instance): mapped_names.append(item.name) # Add the names added as extra keywords to current or parent items