@@ -41,15 +41,6 @@ def test_successful_coverage(self) -> None:
41
41
[1 ,2 ,3 ],
42
42
missing = "3" ,
43
43
)
44
- # You can specify a list of possible missing lines.
45
- self .check_coverage ("""\
46
- a = 1
47
- if a == 2:
48
- a = 3
49
- """ ,
50
- [1 ,2 ,3 ],
51
- missing = ("47-49" , "3" , "100,102" ),
52
- )
53
44
54
45
def test_failed_coverage (self ) -> None :
55
46
# If the lines are wrong, the message shows right and wrong.
@@ -79,17 +70,6 @@ def test_failed_coverage(self) -> None:
79
70
[1 ,2 ,3 ],
80
71
missing = "37" ,
81
72
)
82
- # If the missing lines possibilities are wrong, the msg shows right.
83
- msg = r"None of the missing choices matched '3'"
84
- with pytest .raises (AssertionError , match = msg ):
85
- self .check_coverage ("""\
86
- a = 1
87
- if a == 2:
88
- a = 3
89
- """ ,
90
- [1 ,2 ,3 ],
91
- missing = ("37" , "4-10" ),
92
- )
93
73
94
74
def test_exceptions_really_fail (self ) -> None :
95
75
# An assert in the checked code will really raise up to us.
@@ -502,6 +482,7 @@ def test_continue(self) -> None:
502
482
)
503
483
504
484
def test_strange_unexecuted_continue (self ) -> None :
485
+ # This used to be true, but no longer is:
505
486
# Peephole optimization of jumps to jumps can mean that some statements
506
487
# never hit the line tracer. The behavior is different in different
507
488
# versions of Python, so be careful when running this test.
@@ -529,7 +510,7 @@ def test_strange_unexecuted_continue(self) -> None:
529
510
assert a == 33 and b == 50 and c == 50
530
511
""" ,
531
512
lines = [1 ,2 ,3 ,4 ,5 ,6 ,8 ,9 ,10 , 12 ,13 ,14 ,15 ,16 ,17 ,19 ,20 ,21 ],
532
- missing = [ "" , "6" ] ,
513
+ missing = "" ,
533
514
)
534
515
535
516
def test_import (self ) -> None :
@@ -682,14 +663,13 @@ def test_module_docstring(self) -> None:
682
663
""" ,
683
664
[2 , 3 ],
684
665
)
685
- lines = [2 , 3 , 4 ]
686
666
self .check_coverage ("""\
687
667
# Start with a comment, because it changes the behavior(!?)
688
668
'''I am a module docstring.'''
689
669
a = 3
690
670
b = 4
691
671
""" ,
692
- lines ,
672
+ [ 2 , 3 , 4 ] ,
693
673
)
694
674
695
675
0 commit comments