From 8d436165074e91784a3bbe0210280c93cebb05f2 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 3 Sep 2026 23:58:43 +0200 Subject: [PATCH] Address review: marker scan covers every usage form including multiline pytestmark lists --- script/helpers.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/script/helpers.py b/script/helpers.py index 2e0d9abe26..a8a237118f 100644 --- a/script/helpers.py +++ b/script/helpers.py @@ -1104,11 +1104,9 @@ def get_components_per_integration_fixture() -> dict[str, set[str]]: _TEST_FUNC_RE = re.compile(r"async def (test_\w+)") -# 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 -) +# Any usage form (decorator, pytestmark assignment or list element); only +# test_*.py files are scanned, so the marker docs elsewhere cannot false-hit +_SHARED_YAML_USE_RE = re.compile(r"\bmark\.shared_yaml") _SHARED_YAML_ARG_RE = re.compile(r"\(\s*[\"'](\w+)[\"']\s*\)")