From 24145b0bb0368868b8aa2e8cc0eb43324533367d Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 13 Feb 2016 07:48:10 -0500 Subject: More progress on better missed-branch descriptions --- tests/test_html.py | 9 +++------ tests/test_parser.py | 5 +++++ 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/test_html.py b/tests/test_html.py index fda68aeb..67c6d9b6 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -525,15 +525,12 @@ class HtmlGoldTests(CoverageGoldTest): '3'), '70%', ('8 ↛ 11' - 'Line 8 was executed, ' - 'but didn\'t jump to line 11'), + 'line 8 didn\'t jump to line 11, because the condition on line 8 was never false'), ('17 ↛ exit' - 'Line 17 was executed, ' - 'but didn\'t exit function "two"'), + 'line 17 didn\'t return from function \'two\', because the condition on line 17 was never false'), ('25 ↛ 26,   ' '25 ↛ 28' - 'Line 25 was executed, ' - 'but didn\'t jump to line 26 or jump to line 282 missed branches: 1) line 25 didn\'t jump to line 26, because the condition on line 25 was never true, 2) line 25 didn\'t jump to line 28, because the condition on line 25 was never false'), ) contains( "out/b_branch/index.html", diff --git a/tests/test_parser.py b/tests/test_parser.py index fd820b9b..cf433009 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -192,6 +192,7 @@ class ParserMissingArcDescriptionTest(CoverageTest): run_in_temp_dir = False def test_missing_arc_description(self): + # This code is never run, so the actual values don't matter. text = textwrap.dedent(u"""\ if x: print(2) @@ -216,6 +217,10 @@ class ParserMissingArcDescriptionTest(CoverageTest): parser.missing_arc_description(6, -5), "line 6 didn't return from function 'func5', because the loop on line 6 didn't complete" ) + self.assertEqual( + parser.missing_arc_description(6, 7), + "line 6 didn't jump to line 7, because the loop on line 6 never started" + ) class ParserFileTest(CoverageTest): -- cgit v1.2.1