mirror of
https://github.com/esphome/esphome.git
synced 2026-11-09 14:45:57 +00:00
[sensor] Defer integration imports out of module scope (#18353)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
5a4025ee12
commit
ebdd9fe07e
9 files changed
+48
-47
No files matched your search
@@ -2788,8 +2788,8 @@ def test_should_run_benchmarks_core_benchmark_file_change() -> None:
|
||||
def test_python_import_benchmarked_components_imports_real_components() -> None:
|
||||
"""The set is what importing the real benchmark's components loads."""
|
||||
loaded = determine_jobs.python_import_benchmarked_components()
|
||||
# mqtt is not listed in COMPONENTS; sensor imports it at module scope
|
||||
assert {"binary_sensor", "sensor", "logger", "mqtt"} <= loaded
|
||||
# What else they pull in changes as imports are deferred, so only the listed ones are pinned
|
||||
assert {"binary_sensor", "sensor", "logger"} <= loaded
|
||||
|
||||
|
||||
def test_should_run_benchmarks_python_import_benchmarked_component() -> None:
|
||||
|
||||
Reference in new issue
Block a user