diff options
-rw-r--r-- | tests/test_coverage.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_coverage.py b/tests/test_coverage.py index 02b577e5..89c8e9f4 100644 --- a/tests/test_coverage.py +++ b/tests/test_coverage.py @@ -368,6 +368,16 @@ class SimpleStatementTest(CoverageTest): """, [1,2,5,6], "") + def test_raise_followed_by_statement(self): + self.check_coverage("""\ + try: + raise Exception("hello") + a = 3 + except: + pass + """, + [1,2,3,4,5], "3") + def test_return(self): self.check_coverage("""\ def fn(): @@ -401,6 +411,18 @@ class SimpleStatementTest(CoverageTest): """, [1,2,3,7,8], "") + def test_return_followed_by_statement(self): + self.check_coverage("""\ + def fn(): + a = 1 + return a + a = 2 + + x = fn() + assert(x == 1) + """, + [1,2,3,4,6,7], "4") + def test_yield(self): self.check_coverage("""\ def gen(): |