3
3
4
4
"""Tests for coverage.py's arc measurement."""
5
5
6
- from tests .coveragetest import CoverageTest
6
+ from tests .coveragetest import CoverageTest , xfail
7
7
8
8
import coverage
9
9
from coverage import env
@@ -629,9 +629,8 @@ def test_finally_in_loop(self):
629
629
)
630
630
631
631
632
+ @xfail (env .PYBEHAVIOR .bpo39114 , reason = "https://bugs.python.org/issue39114" )
632
633
def test_break_through_finally (self ):
633
- if env .PYBEHAVIOR .bpo39114 :
634
- self .xfail ("https://bugs.python.org/issue39114" )
635
634
if env .PYBEHAVIOR .finally_jumps_back :
636
635
arcz = ".1 12 23 34 3D 45 56 67 68 7A 7D 8A A3 A7 BC CD D."
637
636
else :
@@ -655,9 +654,8 @@ def test_break_through_finally(self):
655
654
arcz_missing = "3D BC CD" ,
656
655
)
657
656
657
+ @xfail (env .PYBEHAVIOR .bpo39114 , "https://bugs.python.org/issue39114" )
658
658
def test_continue_through_finally (self ):
659
- if env .PYBEHAVIOR .bpo39114 :
660
- self .xfail ("https://bugs.python.org/issue39114" )
661
659
if env .PYBEHAVIOR .finally_jumps_back :
662
660
arcz = ".1 12 23 34 3D 45 56 67 68 73 7A 8A A3 A7 BC CD D."
663
661
else :
@@ -694,9 +692,8 @@ def test_finally_in_loop_bug_92(self):
694
692
arcz = ".1 12 23 35 56 61 17 7." ,
695
693
)
696
694
695
+ @xfail (env .PYBEHAVIOR .bpo39114 , "https://bugs.python.org/issue39114" )
697
696
def test_bug_212 (self ):
698
- if env .PYBEHAVIOR .bpo39114 :
699
- self .xfail ("https://bugs.python.org/issue39114" )
700
697
# "except Exception as e" is crucial here.
701
698
# Bug 212 said that the "if exc" line was incorrectly marked as only
702
699
# partially covered.
@@ -818,9 +815,8 @@ def test_multiple_except_clauses(self):
818
815
arcz_unpredicted = "45 7A AB" ,
819
816
)
820
817
818
+ @xfail (env .PYBEHAVIOR .bpo39114 , "https://bugs.python.org/issue39114" )
821
819
def test_return_finally (self ):
822
- if env .PYBEHAVIOR .bpo39114 :
823
- self .xfail ("https://bugs.python.org/issue39114" )
824
820
if env .PYBEHAVIOR .finally_jumps_back :
825
821
arcz = ".1 12 29 9A AB BC C-1 -23 34 45 5-2 57 75 38 8-2"
826
822
else :
@@ -842,9 +838,8 @@ def check_token(data):
842
838
arcz = arcz ,
843
839
)
844
840
841
+ @xfail (env .PYBEHAVIOR .bpo39114 , "https://bugs.python.org/issue39114" )
845
842
def test_except_jump_finally (self ):
846
- if env .PYBEHAVIOR .bpo39114 :
847
- self .xfail ("https://bugs.python.org/issue39114" )
848
843
if env .PYBEHAVIOR .finally_jumps_back :
849
844
arcz = (
850
845
".1 1Q QR RS ST TU U. "
@@ -898,9 +893,8 @@ def func(x):
898
893
arcz_unpredicted = "67" ,
899
894
)
900
895
896
+ @xfail (env .PYBEHAVIOR .bpo39114 , "https://bugs.python.org/issue39114" )
901
897
def test_else_jump_finally (self ):
902
- if env .PYBEHAVIOR .bpo39114 :
903
- self .xfail ("https://bugs.python.org/issue39114" )
904
898
if env .PYBEHAVIOR .finally_jumps_back :
905
899
arcz = (
906
900
".1 1S ST TU UV VW W. "
@@ -1522,9 +1516,8 @@ async def print_sum(x, y): # 8
1522
1516
)
1523
1517
self .assertEqual (self .stdout (), "Compute 1 + 2 ...\n 1 + 2 = 3\n " )
1524
1518
1519
+ @xfail (env .PYVERSION == (3 , 9 , 0 , 'alpha' , 2 , 0 ), "https://bugs.python.org/issue39166" )
1525
1520
def test_async_for (self ):
1526
- if env .PYVERSION == (3 , 9 , 0 , 'alpha' , 2 , 0 ):
1527
- self .xfail ("https://bugs.python.org/issue39166" )
1528
1521
self .check_coverage ("""\
1529
1522
import asyncio
1530
1523
0 commit comments