From 818b95a85facfc793d6a652ca6467405c7d37c7c Mon Sep 17 00:00:00 2001 From: Aaron Traas Date: Sun, 16 Jul 2017 07:27:39 -0400 Subject: [PATCH] YAML coverage generator minor cleanup --- tests/coverage_dungeon.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/coverage_dungeon.py b/tests/coverage_dungeon.py index b5afa08..d530c82 100755 --- a/tests/coverage_dungeon.py +++ b/tests/coverage_dungeon.py @@ -219,7 +219,8 @@ if __name__ == "__main__": category["percent"] = (category["covered"] / float(category["total"])) * 100 # render section header - cat_keys = list(category["messages"].items())[0][1].keys() + cat_messages = sorted(category["messages"].items()) + cat_keys = cat_messages[0][1].keys() headers_html = "" colspan = 10 - len(cat_keys) for key in cat_keys: @@ -227,7 +228,7 @@ if __name__ == "__main__": category_html = HTML_CATEGORY_HEADER.format(colspan=colspan, label=category["name"], cells=headers_html) # render message coverage row - for message_id, covered in sorted(category["messages"].items()): + for message_id, covered in cat_messages: category_html_row = "" for key, value in covered.items(): category_html_row += HTML_CATEGORY_COVERAGE_CELL.format("uncovered" if value != True else "covered") -- 2.31.1