From a5bbac084aa754a0a210cca4f17833c8a6e02e5c Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 3 Sep 2026 23:40:58 +0200 Subject: [PATCH] Address review: marker scan also covers pytestmark assignments --- script/helpers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/script/helpers.py b/script/helpers.py index 5e4a25a388..2e0d9abe26 100644 --- a/script/helpers.py +++ b/script/helpers.py @@ -1104,7 +1104,11 @@ def get_components_per_integration_fixture() -> dict[str, set[str]]: _TEST_FUNC_RE = re.compile(r"async def (test_\w+)") -_SHARED_YAML_USE_RE = re.compile(r"^\s*@[\w.]*mark\.shared_yaml", re.MULTILINE) +# Decorator form plus module/class-level pytestmark assignments, which +# get_closest_marker honors equally at runtime +_SHARED_YAML_USE_RE = re.compile( + r"^\s*(?:@[\w.]*|pytestmark\s*=.*?\bpytest\.)mark\.shared_yaml", re.MULTILINE +) _SHARED_YAML_ARG_RE = re.compile(r"\(\s*[\"'](\w+)[\"']\s*\)")