File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2545,10 +2545,8 @@ def getdict(self):
25452545 m2instance .b = 2
25462546 m2instance .a = 1
25472547 self .assertEqual (m2instance .__dict__ , "Not a dict!" )
2548- try :
2548+ with self . assertRaises ( TypeError ) :
25492549 dir (m2instance )
2550- except TypeError :
2551- pass
25522550
25532551 # Two essentially featureless objects, (Ellipsis just inherits stuff
25542552 # from object.
@@ -4066,7 +4064,7 @@ class D(C):
40664064 except TypeError :
40674065 pass
40684066 else :
4069- assert 0 , "best_base calculation found wanting"
4067+ self . fail ( "best_base calculation found wanting" )
40704068
40714069 def test_unsubclassable_types (self ):
40724070 with self .assertRaises (TypeError ):
@@ -4452,6 +4450,8 @@ def __getattr__(self, attr):
44524450 print ("Oops!" )
44534451 except RuntimeError :
44544452 pass
4453+ else :
4454+ self .fail ("Didn't raise RuntimeError" )
44554455 finally :
44564456 sys .stdout = test_stdout
44574457
You can’t perform that action at this time.
0 commit comments