mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Issue #19492: Silently skipped distutils tests now reported as skipped.
This commit is contained in:
		
							parent
							
								
									4be1e24933
								
							
						
					
					
						commit
						3c02ecefba
					
				
					 8 changed files with 32 additions and 57 deletions
				
			
		|  | @ -43,18 +43,15 @@ def tearDown(self): | ||||||
|         sys.argv[:] = self.old_sys_argv[1] |         sys.argv[:] = self.old_sys_argv[1] | ||||||
|         super(BuildRpmTestCase, self).tearDown() |         super(BuildRpmTestCase, self).tearDown() | ||||||
| 
 | 
 | ||||||
|  |     # XXX I am unable yet to make this test work without | ||||||
|  |     # spurious sdtout/stderr output under Mac OS X | ||||||
|  |     @unittest.skipUnless(sys.platform.startswith('linux'), | ||||||
|  |                          'spurious sdtout/stderr output under Mac OS X') | ||||||
|  |     @unittest.skipIf(find_executable('rpm') is None, | ||||||
|  |                      'the rpm command is not found') | ||||||
|  |     @unittest.skipIf(find_executable('rpmbuild') is None, | ||||||
|  |                      'the rpmbuild command is not found') | ||||||
|     def test_quiet(self): |     def test_quiet(self): | ||||||
| 
 |  | ||||||
|         # XXX I am unable yet to make this test work without |  | ||||||
|         # spurious sdtout/stderr output under Mac OS X |  | ||||||
|         if not sys.platform.startswith('linux'): |  | ||||||
|             return |  | ||||||
| 
 |  | ||||||
|         # this test will run only if the rpm commands are found |  | ||||||
|         if (find_executable('rpm') is None or |  | ||||||
|             find_executable('rpmbuild') is None): |  | ||||||
|             return |  | ||||||
| 
 |  | ||||||
|         # let's create a package |         # let's create a package | ||||||
|         tmp_dir = self.mkdtemp() |         tmp_dir = self.mkdtemp() | ||||||
|         pkg_dir = os.path.join(tmp_dir, 'foo') |         pkg_dir = os.path.join(tmp_dir, 'foo') | ||||||
|  | @ -87,19 +84,16 @@ def test_quiet(self): | ||||||
|         self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.src.rpm'), dist.dist_files) |         self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.src.rpm'), dist.dist_files) | ||||||
|         self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.noarch.rpm'), dist.dist_files) |         self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.noarch.rpm'), dist.dist_files) | ||||||
| 
 | 
 | ||||||
|  |     # XXX I am unable yet to make this test work without | ||||||
|  |     # spurious sdtout/stderr output under Mac OS X | ||||||
|  |     @unittest.skipUnless(sys.platform.startswith('linux'), | ||||||
|  |                          'spurious sdtout/stderr output under Mac OS X') | ||||||
|  |     # http://bugs.python.org/issue1533164 | ||||||
|  |     @unittest.skipIf(find_executable('rpm') is None, | ||||||
|  |                      'the rpm command is not found') | ||||||
|  |     @unittest.skipIf(find_executable('rpmbuild') is None, | ||||||
|  |                      'the rpmbuild command is not found') | ||||||
|     def test_no_optimize_flag(self): |     def test_no_optimize_flag(self): | ||||||
| 
 |  | ||||||
|         # XXX I am unable yet to make this test work without |  | ||||||
|         # spurious sdtout/stderr output under Mac OS X |  | ||||||
|         if not sys.platform.startswith('linux'): |  | ||||||
|             return |  | ||||||
| 
 |  | ||||||
|         # http://bugs.python.org/issue1533164 |  | ||||||
|         # this test will run only if the rpm command is found |  | ||||||
|         if (find_executable('rpm') is None or |  | ||||||
|             find_executable('rpmbuild') is None): |  | ||||||
|             return |  | ||||||
| 
 |  | ||||||
|         # let's create a package that brakes bdist_rpm |         # let's create a package that brakes bdist_rpm | ||||||
|         tmp_dir = self.mkdtemp() |         tmp_dir = self.mkdtemp() | ||||||
|         pkg_dir = os.path.join(tmp_dir, 'foo') |         pkg_dir = os.path.join(tmp_dir, 'foo') | ||||||
|  |  | ||||||
|  | @ -102,11 +102,8 @@ def test_finalize_options(self): | ||||||
|         cmd.distribution.libraries = 'WONTWORK' |         cmd.distribution.libraries = 'WONTWORK' | ||||||
|         self.assertRaises(DistutilsSetupError, cmd.finalize_options) |         self.assertRaises(DistutilsSetupError, cmd.finalize_options) | ||||||
| 
 | 
 | ||||||
|  |     @unittest.skipIf(sys.platform == 'win32', "can't test on Windows") | ||||||
|     def test_run(self): |     def test_run(self): | ||||||
|         # can't test on windows |  | ||||||
|         if sys.platform == 'win32': |  | ||||||
|             return |  | ||||||
| 
 |  | ||||||
|         pkg_dir, dist = self.create_dist() |         pkg_dir, dist = self.create_dist() | ||||||
|         cmd = build_clib(dist) |         cmd = build_clib(dist) | ||||||
| 
 | 
 | ||||||
|  | @ -131,7 +128,7 @@ def test_run(self): | ||||||
|             if ccmd is None: |             if ccmd is None: | ||||||
|                 continue |                 continue | ||||||
|             if find_executable(ccmd[0]) is None: |             if find_executable(ccmd[0]) is None: | ||||||
|                 return # can't test |                 self.skipTest('The %r command is not found' % ccmd[0]) | ||||||
| 
 | 
 | ||||||
|         # this should work |         # this should work | ||||||
|         cmd.run() |         cmd.run() | ||||||
|  |  | ||||||
|  | @ -61,9 +61,9 @@ def test_build_ext(self): | ||||||
|             sys.stdout = old_stdout |             sys.stdout = old_stdout | ||||||
| 
 | 
 | ||||||
|         if ALREADY_TESTED: |         if ALREADY_TESTED: | ||||||
|             return |             self.skipTest('Already tested in %s' % ALREADY_TESTED) | ||||||
|         else: |         else: | ||||||
|             ALREADY_TESTED = True |             ALREADY_TESTED = type(self).__name__ | ||||||
| 
 | 
 | ||||||
|         import xx |         import xx | ||||||
| 
 | 
 | ||||||
|  | @ -113,10 +113,6 @@ def test_solaris_enable_shared(self): | ||||||
|         self.assertGreater(len(cmd.library_dirs), 0) |         self.assertGreater(len(cmd.library_dirs), 0) | ||||||
| 
 | 
 | ||||||
|     def test_user_site(self): |     def test_user_site(self): | ||||||
|         # site.USER_SITE was introduced in 2.6 |  | ||||||
|         if sys.version < '2.6': |  | ||||||
|             return |  | ||||||
| 
 |  | ||||||
|         import site |         import site | ||||||
|         dist = Distribution({'name': 'xx'}) |         dist = Distribution({'name': 'xx'}) | ||||||
|         cmd = build_ext(dist) |         cmd = build_ext(dist) | ||||||
|  |  | ||||||
|  | @ -55,9 +55,8 @@ def test_check_metadata(self): | ||||||
|         cmd = self._run(metadata) |         cmd = self._run(metadata) | ||||||
|         self.assertEqual(cmd._warnings, 0) |         self.assertEqual(cmd._warnings, 0) | ||||||
| 
 | 
 | ||||||
|  |     @unittest.skipUnless(HAS_DOCUTILS, "won't test without docutils") | ||||||
|     def test_check_document(self): |     def test_check_document(self): | ||||||
|         if not HAS_DOCUTILS: # won't test without docutils |  | ||||||
|             return |  | ||||||
|         pkg_info, dist = self.create_dist() |         pkg_info, dist = self.create_dist() | ||||||
|         cmd = check(dist) |         cmd = check(dist) | ||||||
| 
 | 
 | ||||||
|  | @ -71,9 +70,8 @@ def test_check_document(self): | ||||||
|         msgs = cmd._check_rst_data(rest) |         msgs = cmd._check_rst_data(rest) | ||||||
|         self.assertEqual(len(msgs), 0) |         self.assertEqual(len(msgs), 0) | ||||||
| 
 | 
 | ||||||
|  |     @unittest.skipUnless(HAS_DOCUTILS, "won't test without docutils") | ||||||
|     def test_check_restructuredtext(self): |     def test_check_restructuredtext(self): | ||||||
|         if not HAS_DOCUTILS: # won't test without docutils |  | ||||||
|             return |  | ||||||
|         # let's see if it detects broken rest in long_description |         # let's see if it detects broken rest in long_description | ||||||
|         broken_rest = 'title\n===\n\ntest' |         broken_rest = 'title\n===\n\ntest' | ||||||
|         pkg_info, dist = self.create_dist(long_description=broken_rest) |         pkg_info, dist = self.create_dist(long_description=broken_rest) | ||||||
|  |  | ||||||
|  | @ -37,9 +37,8 @@ def test_dump_file(self): | ||||||
|         dump_file(this_file, 'I am the header') |         dump_file(this_file, 'I am the header') | ||||||
|         self.assertEqual(len(self._logs), numlines+1) |         self.assertEqual(len(self._logs), numlines+1) | ||||||
| 
 | 
 | ||||||
|  |     @unittest.skipIf(sys.platform == 'win32', "can't test on Windows") | ||||||
|     def test_search_cpp(self): |     def test_search_cpp(self): | ||||||
|         if sys.platform == 'win32': |  | ||||||
|             return |  | ||||||
|         pkg_dir, dist = self.create_dist() |         pkg_dir, dist = self.create_dist() | ||||||
|         cmd = config(dist) |         cmd = config(dist) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -125,13 +125,11 @@ def test_prune_file_list(self): | ||||||
|         self.assertEqual(len(content), 4) |         self.assertEqual(len(content), 4) | ||||||
| 
 | 
 | ||||||
|     @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run') |     @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run') | ||||||
|  |     @unittest.skipIf(find_executable('tar') is None, | ||||||
|  |                      "The tar command is not found") | ||||||
|  |     @unittest.skipIf(find_executable('gzip') is None, | ||||||
|  |                      "The gzip command is not found") | ||||||
|     def test_make_distribution(self): |     def test_make_distribution(self): | ||||||
| 
 |  | ||||||
|         # check if tar and gzip are installed |  | ||||||
|         if (find_executable('tar') is None or |  | ||||||
|             find_executable('gzip') is None): |  | ||||||
|             return |  | ||||||
| 
 |  | ||||||
|         # now building a sdist |         # now building a sdist | ||||||
|         dist, cmd = self.get_cmd() |         dist, cmd = self.get_cmd() | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -82,12 +82,9 @@ def test_srcdir_independent_of_cwd(self): | ||||||
|             os.chdir(cwd) |             os.chdir(cwd) | ||||||
|         self.assertEqual(srcdir, srcdir2) |         self.assertEqual(srcdir, srcdir2) | ||||||
| 
 | 
 | ||||||
|  |     @unittest.skipUnless(get_default_compiler() == 'unix', | ||||||
|  |                          'not testing if default compiler is not unix') | ||||||
|     def test_customize_compiler(self): |     def test_customize_compiler(self): | ||||||
| 
 |  | ||||||
|         # not testing if default compiler is not unix |  | ||||||
|         if get_default_compiler() != 'unix': |  | ||||||
|             return |  | ||||||
| 
 |  | ||||||
|         os.environ['AR'] = 'my_ar' |         os.environ['AR'] = 'my_ar' | ||||||
|         os.environ['ARFLAGS'] = '-arflags' |         os.environ['ARFLAGS'] = '-arflags' | ||||||
| 
 | 
 | ||||||
|  | @ -150,7 +147,7 @@ def test_sysconfig_compiler_vars(self): | ||||||
| 
 | 
 | ||||||
|         import sysconfig as global_sysconfig |         import sysconfig as global_sysconfig | ||||||
|         if sysconfig.get_config_var('CUSTOMIZED_OSX_COMPILER'): |         if sysconfig.get_config_var('CUSTOMIZED_OSX_COMPILER'): | ||||||
|             return |             self.skipTest('compiler flags customized') | ||||||
|         self.assertEqual(global_sysconfig.get_config_var('LDSHARED'), sysconfig.get_config_var('LDSHARED')) |         self.assertEqual(global_sysconfig.get_config_var('LDSHARED'), sysconfig.get_config_var('LDSHARED')) | ||||||
|         self.assertEqual(global_sysconfig.get_config_var('CC'), sysconfig.get_config_var('CC')) |         self.assertEqual(global_sysconfig.get_config_var('CC'), sysconfig.get_config_var('CC')) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -21,12 +21,8 @@ def tearDown(self): | ||||||
|         sys.platform = self._backup_platform |         sys.platform = self._backup_platform | ||||||
|         sysconfig.get_config_var = self._backup_get_config_var |         sysconfig.get_config_var = self._backup_get_config_var | ||||||
| 
 | 
 | ||||||
|  |     @unittest.skipIf(sys.platform == 'win32', "can't test on Windows") | ||||||
|     def test_runtime_libdir_option(self): |     def test_runtime_libdir_option(self): | ||||||
| 
 |  | ||||||
|         # not tested under windows |  | ||||||
|         if sys.platform == 'win32': |  | ||||||
|             return |  | ||||||
| 
 |  | ||||||
|         # Issue#5900 |         # Issue#5900 | ||||||
|         # |         # | ||||||
|         # Ensure RUNPATH is added to extension modules with RPATH if |         # Ensure RUNPATH is added to extension modules with RPATH if | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Serhiy Storchaka
						Serhiy Storchaka