diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2013-11-17 00:20:12 +0200 |
|---|---|---|
| committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-11-17 00:20:12 +0200 |
| commit | 954834c227df70628fb7dba9f0741aab06a44920 (patch) | |
| tree | c3b26408f9b20bf77493b2bc42e1a014590ecb33 /tests/test_build_ext.py | |
| parent | ad0f0c5c29e6c8af182a9e72d995d91911cc8349 (diff) | |
| parent | c0d4c5676e3118c7189a97a555bfb70447276f29 (diff) | |
| download | python-setuptools-git-954834c227df70628fb7dba9f0741aab06a44920.tar.gz | |
Issue #19600: Use specific asserts in distutils tests.
Diffstat (limited to 'tests/test_build_ext.py')
| -rw-r--r-- | tests/test_build_ext.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/test_build_ext.py b/tests/test_build_ext.py index 44a9852f..3cfaa2c6 100644 --- a/tests/test_build_ext.py +++ b/tests/test_build_ext.py @@ -76,8 +76,8 @@ class BuildExtTestCase(TempdirManager, if support.HAVE_DOCSTRINGS: doc = 'This is a template module just for instruction.' self.assertEqual(xx.__doc__, doc) - self.assertTrue(isinstance(xx.Null(), xx.Null)) - self.assertTrue(isinstance(xx.Str(), xx.Str)) + self.assertIsInstance(xx.Null(), xx.Null) + self.assertIsInstance(xx.Str(), xx.Str) def tearDown(self): # Get everything back to normal @@ -110,7 +110,7 @@ class BuildExtTestCase(TempdirManager, _config_vars['Py_ENABLE_SHARED'] = old_var # make sure we get some library dirs under solaris - self.assertTrue(len(cmd.library_dirs) > 0) + self.assertGreater(len(cmd.library_dirs), 0) def test_user_site(self): # site.USER_SITE was introduced in 2.6 @@ -124,7 +124,7 @@ class BuildExtTestCase(TempdirManager, # making sure the user option is there options = [name for name, short, lable in cmd.user_options] - self.assertTrue('user' in options) + self.assertIn('user', options) # setting a value cmd.user = 1 @@ -171,10 +171,10 @@ class BuildExtTestCase(TempdirManager, from distutils import sysconfig py_include = sysconfig.get_python_inc() - self.assertTrue(py_include in cmd.include_dirs) + self.assertIn(py_include, cmd.include_dirs) plat_py_include = sysconfig.get_python_inc(plat_specific=1) - self.assertTrue(plat_py_include in cmd.include_dirs) + self.assertIn(plat_py_include, cmd.include_dirs) # make sure cmd.libraries is turned into a list # if it's a string @@ -255,13 +255,13 @@ class BuildExtTestCase(TempdirManager, 'some': 'bar'})] cmd.check_extensions_list(exts) ext = exts[0] - self.assertTrue(isinstance(ext, Extension)) + self.assertIsInstance(ext, Extension) # check_extensions_list adds in ext the values passed # when they are in ('include_dirs', 'library_dirs', 'libraries' # 'extra_objects', 'extra_compile_args', 'extra_link_args') self.assertEqual(ext.libraries, 'foo') - self.assertTrue(not hasattr(ext, 'some')) + self.assertFalse(hasattr(ext, 'some')) # 'macros' element of build info dict must be 1- or 2-tuple exts = [('foo.bar', {'sources': [''], 'libraries': 'foo', |
