Skip to content

Commit

Permalink
unify option extraction for legacy hook marks
Browse files Browse the repository at this point in the history
  • Loading branch information
RonnyPfannschmidt committed Sep 20, 2022
1 parent aa52e1d commit 478ace4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/_pytest/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 478ace4

Please sign in to comment.