From 947eaab26f26a990faed7be89d40c7da436bf1fe Mon Sep 17 00:00:00 2001 From: Micah Jerome Ellison Date: Sat, 16 Jan 2021 13:55:09 -0800 Subject: [PATCH] Make output clearer on failing test --- features/steps/export_steps.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/features/steps/export_steps.py b/features/steps/export_steps.py index 6a5c8e46..f885591c 100644 --- a/features/steps/export_steps.py +++ b/features/steps/export_steps.py @@ -169,17 +169,24 @@ def assert_exported_yaml_file_content(context, file_path, cache_dir=None): for actual_line, expected_line in zip(actual_content, expected_content): if actual_line.startswith("tags: ") and expected_line.startswith("tags: "): - assert_equal_tags_ignoring_order(actual_line, expected_line) + assert_equal_tags_ignoring_order( + actual_line, expected_line, actual_content, expected_content + ) else: assert actual_line.strip() == expected_line.strip(), [ - actual_line.strip(), - expected_line.strip(), + [actual_line.strip(), expected_line.strip()], + [actual_content, expected_content], ] -def assert_equal_tags_ignoring_order(actual_line, expected_line): +def assert_equal_tags_ignoring_order( + actual_line, expected_line, actual_content, expected_content +): actual_tags = set(tag.strip() for tag in actual_line[len("tags: ") :].split(",")) expected_tags = set( tag.strip() for tag in expected_line[len("tags: ") :].split(",") ) - assert actual_tags == expected_tags, [actual_tags, expected_tags] + assert actual_tags == expected_tags, [ + [actual_tags, expected_tags], + [expected_content, actual_content], + ]