Browse Source

Device config tests: output config name when duplicates detected

When duplicate entities are detected, override the assertion message to
report the config.
Jason Rumney 1 năm trước cách đây
mục cha
commit
f144970fbe
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      tests/test_device_config.py

+ 5 - 1
tests/test_device_config.py

@@ -512,7 +512,11 @@ class TestDeviceConfig(IsolatedAsyncioTestCase):
                 self.check_entity(entity, cfg)
                 entities.append(entity.config_id)
             # check entities are unique
-            self.assertCountEqual(entities, set(entities))
+            self.assertCountEqual(
+                entities,
+                set(entities),
+                f"Duplicate entities in {cfg}",
+            )
 
             # If there are no secondary entities, check that it is intended
             if not secondary: