Prevent const.py in coverage ignore list (#117625)

This commit is contained in:
epenet
2024-05-17 12:53:58 +02:00
committed by GitHub
parent 098ba125d1
commit eacbebce22
2 changed files with 4 additions and 22 deletions

View File

@@ -105,13 +105,12 @@ def validate(integrations: dict[str, Integration], config: Config) -> None:
integration = integrations[integration_path.name]
if (
path.parts[-1] == "*"
and Path(f"tests/components/{integration.domain}/__init__.py").exists()
):
if (last_part := path.parts[-1]) in {"*", "const.py"} and Path(
f"tests/components/{integration.domain}/__init__.py"
).exists():
integration.add_error(
"coverage",
"has tests and should not use wildcard in .coveragerc file",
f"has tests and should not use {last_part} in .coveragerc file",
)
for check in DONT_IGNORE: