Explorar o código

Device config tests: output config name when duplicates detected

When duplicate entities are detected, override the assertion message to
report the config.
Jason Rumney hai 1 ano
pai
achega
f144970fbe
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  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: