Просмотр исходного кода

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 год назад
Родитель
Сommit
f144970fbe
1 измененных файлов с 5 добавлено и 1 удалено
  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: