Skip to content

Commit d1dc988

Browse files
committed
Improve counting of tested entities, tests/asserts
1 parent 797b910 commit d1dc988

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/test_init.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,13 +550,14 @@ async def device_test(
550550
def test_and_assert(test_dict, data, header):
551551
"""Test-and-assert helper-function."""
552552
tests = 0
553+
tested_items = 0
553554
asserts = 0
554555
bsw_list = ["binary_sensors", "central", "climate", "sensors", "switches"]
555556
for testitem, measurements in test_dict.items():
556557
item_asserts = 0
557558
tests += 1
558559
assert testitem in data
559-
asserts += 1
560+
tested_items += 1
560561
for data_id, details in data.items():
561562
if testitem == data_id:
562563
_LOGGER.info(
@@ -594,7 +595,8 @@ def test_and_assert(test_dict, data, header):
594595
item_asserts += 1
595596
_LOGGER.debug("Item %s test-asserts: %s", testitem, item_asserts)
596597

597-
assert tests == asserts
598+
assert tests == asserts + tested_items
599+
_LOGGER.debug("Total items tested: %s", tested_items)
598600
_LOGGER.debug("Total entity test-asserts: %s", asserts)
599601

600602
# pragma warning disable S3776

0 commit comments

Comments
 (0)