Address review: decorator anchored guard, validated stamp path, max mtime age probe, stray file reclaim

This commit is contained in:
J. Nick Koston
2026-09-03 19:55:15 +02:00
parent 900dd63883
commit 19f5641706
2 changed files with 25 additions and 10 deletions
+2 -1
View File
@@ -1105,6 +1105,7 @@ def get_components_per_integration_fixture() -> dict[str, set[str]]:
_TEST_FUNC_RE = re.compile(r"async def (test_\w+)")
_SHARED_YAML_RE = re.compile(r"@pytest\.mark\.shared_yaml\([\"'](\w+)[\"']\)")
_SHARED_YAML_DECORATOR_RE = re.compile(r"@pytest\.mark\.shared_yaml\(")
@cache
@@ -1126,7 +1127,7 @@ def get_fixture_to_test_files() -> dict[str, frozenset[str]]:
result.setdefault(base_name, set()).add(rel_path)
# Shared fixtures are named by marker, not by a test function
names = _SHARED_YAML_RE.findall(content)
if len(names) != content.count("pytest.mark.shared_yaml("):
if len(names) != len(_SHARED_YAML_DECORATOR_RE.findall(content)):
# A wrapped or non-literal marker would silently drop the mapping
# and CI would select no tests for that fixture
raise ValueError(