From 7e8a4849d819e53248bb0eb2e08f4183d9c7e4d6 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Tue, 20 Sep 2022 15:55:13 +0200 Subject: [PATCH] unify option extraction for legacy hook marks --- src/_pytest/config/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 51d79deba..cffbb6dc4 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -358,9 +358,9 @@ def _get_legacy_hook_marks( opt_attr = getattr(method, opt_name, AttributeError) if opt_attr is not AttributeError: must_warn.append(f"{opt_name}={opt_attr}") + opts[opt_name] = True elif opt_name in known_marks: must_warn.append(f"{opt_name}=True") - if hasattr(method, opt_name) or opt_name in known_marks: opts[opt_name] = True else: opts[opt_name] = False