Skip to content

Commit 331f66b

Browse files
committed
Tests of statements after raise and return
1 parent fddad86 commit 331f66b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/test_coverage.py

+22
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,16 @@ def test_raise(self):
368368
""",
369369
[1,2,5,6], "")
370370

371+
def test_raise_followed_by_statement(self):
372+
self.check_coverage("""\
373+
try:
374+
raise Exception("hello")
375+
a = 3
376+
except:
377+
pass
378+
""",
379+
[1,2,3,4,5], "3")
380+
371381
def test_return(self):
372382
self.check_coverage("""\
373383
def fn():
@@ -401,6 +411,18 @@ def fn():
401411
""",
402412
[1,2,3,7,8], "")
403413

414+
def test_return_followed_by_statement(self):
415+
self.check_coverage("""\
416+
def fn():
417+
a = 1
418+
return a
419+
a = 2
420+
421+
x = fn()
422+
assert(x == 1)
423+
""",
424+
[1,2,3,4,6,7], "4")
425+
404426
def test_yield(self):
405427
self.check_coverage("""\
406428
def gen():

0 commit comments

Comments
 (0)