Răsfoiți Sursa

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 an în urmă
părinte
comite
f144970fbe
1 a modificat fișierele cu 5 adăugiri și 1 ștergeri
  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)
                 self.check_entity(entity, cfg)
                 entities.append(entity.config_id)
                 entities.append(entity.config_id)
             # check entities are unique
             # 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 there are no secondary entities, check that it is intended
             if not secondary:
             if not secondary: