@@ -10,13 +10,11 @@ class ExceptionClassTests(unittest.TestCase):
1010 inheritance hierarchy)"""
1111
1212 def test_builtins_new_style (self ):
13- self .assertTrue ( issubclass ( Exception , object ) )
13+ self .assertIsSubclass ( Exception , object )
1414
1515 def verify_instance_interface (self , ins ):
1616 for attr in ("args" , "__str__" , "__repr__" ):
17- self .assertTrue (hasattr (ins , attr ),
18- "%s missing %s attribute" %
19- (ins .__class__ .__name__ , attr ))
17+ self .assertHasAttr (ins , attr )
2018
2119 def test_inheritance (self ):
2220 # Make sure the inheritance hierarchy matches the documentation
@@ -65,7 +63,7 @@ def test_inheritance(self):
6563 elif last_depth > depth :
6664 while superclasses [- 1 ][0 ] >= depth :
6765 superclasses .pop ()
68- self .assertTrue ( issubclass ( exc , superclasses [- 1 ][1 ]) ,
66+ self .assertIsSubclass ( exc , superclasses [- 1 ][1 ],
6967 "%s is not a subclass of %s" % (exc .__name__ ,
7068 superclasses [- 1 ][1 ].__name__ ))
7169 try : # Some exceptions require arguments; just skip them
0 commit comments