@@ -76,8 +76,8 @@ def test_build_ext(self):
7676 if support .HAVE_DOCSTRINGS :
7777 doc = 'This is a template module just for instruction.'
7878 self .assertEqual (xx .__doc__ , doc )
79- self .assertTrue ( isinstance ( xx .Null (), xx .Null ) )
80- self .assertTrue ( isinstance ( xx .Str (), xx .Str ) )
79+ self .assertIsInstance ( xx .Null (), xx .Null )
80+ self .assertIsInstance ( xx .Str (), xx .Str )
8181
8282 def tearDown (self ):
8383 # Get everything back to normal
@@ -110,7 +110,7 @@ def test_solaris_enable_shared(self):
110110 _config_vars ['Py_ENABLE_SHARED' ] = old_var
111111
112112 # make sure we get some library dirs under solaris
113- self .assertTrue (len (cmd .library_dirs ) > 0 )
113+ self .assertGreater (len (cmd .library_dirs ), 0 )
114114
115115 def test_user_site (self ):
116116 # site.USER_SITE was introduced in 2.6
@@ -124,7 +124,7 @@ def test_user_site(self):
124124 # making sure the user option is there
125125 options = [name for name , short , lable in
126126 cmd .user_options ]
127- self .assertTrue ('user' in options )
127+ self .assertIn ('user' , options )
128128
129129 # setting a value
130130 cmd .user = 1
@@ -171,10 +171,10 @@ def test_finalize_options(self):
171171
172172 from distutils import sysconfig
173173 py_include = sysconfig .get_python_inc ()
174- self .assertTrue (py_include in cmd .include_dirs )
174+ self .assertIn (py_include , cmd .include_dirs )
175175
176176 plat_py_include = sysconfig .get_python_inc (plat_specific = 1 )
177- self .assertTrue (plat_py_include in cmd .include_dirs )
177+ self .assertIn (plat_py_include , cmd .include_dirs )
178178
179179 # make sure cmd.libraries is turned into a list
180180 # if it's a string
@@ -255,13 +255,13 @@ def test_check_extensions_list(self):
255255 'some' : 'bar' })]
256256 cmd .check_extensions_list (exts )
257257 ext = exts [0 ]
258- self .assertTrue ( isinstance ( ext , Extension ) )
258+ self .assertIsInstance ( ext , Extension )
259259
260260 # check_extensions_list adds in ext the values passed
261261 # when they are in ('include_dirs', 'library_dirs', 'libraries'
262262 # 'extra_objects', 'extra_compile_args', 'extra_link_args')
263263 self .assertEqual (ext .libraries , 'foo' )
264- self .assertTrue ( not hasattr (ext , 'some' ))
264+ self .assertFalse ( hasattr (ext , 'some' ))
265265
266266 # 'macros' element of build info dict must be 1- or 2-tuple
267267 exts = [('foo.bar' , {'sources' : ['' ], 'libraries' : 'foo' ,
0 commit comments