1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Include deprecated constants in wildcard imports (#107114)

This commit is contained in:
Erik Montnemery
2024-01-05 11:46:45 +01:00
committed by GitHub
parent c063bf403a
commit c805ea7b4f
52 changed files with 438 additions and 137 deletions

View File

@@ -429,7 +429,7 @@ def test_test_check_if_deprecated_constant_invalid(
@pytest.mark.parametrize(
("module_global", "expected"),
("module_globals", "expected"),
[
({"CONSTANT": 1}, ["CONSTANT"]),
({"_DEPRECATED_CONSTANT": 1}, ["_DEPRECATED_CONSTANT", "CONSTANT"]),
@@ -440,7 +440,7 @@ def test_test_check_if_deprecated_constant_invalid(
],
)
def test_dir_with_deprecated_constants(
module_global: dict[str, Any], expected: list[str]
module_globals: dict[str, Any], expected: list[str]
) -> None:
"""Test dir() with deprecated constants."""
assert dir_with_deprecated_constants(module_global) == expected
assert dir_with_deprecated_constants([*module_globals.keys()]) == expected