File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -65,11 +65,8 @@ def test_non_zero(self):
65
65
66
66
def test_throws_x_out_of_range (self ):
67
67
b = Bitmap_C_Interface (2 , 4 , 1 )
68
- try :
68
+ with self . assertRaises ( ValueError ) :
69
69
b [2 , 1 ] = 100
70
- self .fail ("should have thrown" )
71
- except ValueError :
72
- pass
73
70
74
71
def test_max (self ):
75
72
b = Bitmap_C_Interface (2 , 4 , 1 )
@@ -78,18 +75,13 @@ def test_max(self):
78
75
79
76
def test_uninitialized (self ):
80
77
b = Bitmap_C_Interface (2 , 4 , 1 )
81
- try :
78
+ with self . assertRaises ( RuntimeError ) :
82
79
b [1 , 1 ]
83
- self .fail ("should have thrown" )
84
- except RuntimeError :
85
- pass
86
80
87
- def test_validate_throws (self ):
81
+ def test_validate_throws ():
88
82
b = Bitmap_C_Interface (2 , 4 , 1 )
89
- try :
83
+ with self . assertRaises ( ValueError ) :
90
84
b .validate ()
91
- except ValueError :
92
- pass
93
85
94
86
def test_repr (self ):
95
87
b = Bitmap_C_Interface (3 , 2 , 1 )
You can’t perform that action at this time.
0 commit comments