cpython: 6a3501aab559 (original) (raw)

Mercurial > cpython

changeset 87161:6a3501aab559

Issue #19600: Use specific asserts in distutils tests. [#19600]

Serhiy Storchaka storchaka@gmail.com
date Sun, 17 Nov 2013 00:20:12 +0200
parents aacb0bd969e5(current diff)5a0236f3f972(diff)
children 829b95824867 6a6ecc7149f4
files Lib/distutils/tests/test_archive_util.py Lib/distutils/tests/test_config.py Lib/distutils/tests/test_install.py Lib/distutils/tests/test_install_lib.py Lib/distutils/tests/test_util.py
diffstat 16 files changed, 36 insertions(+), 36 deletions(-)[+] [-] Lib/distutils/tests/test_archive_util.py 2 Lib/distutils/tests/test_bdist_rpm.py 4 Lib/distutils/tests/test_bdist_wininst.py 2 Lib/distutils/tests/test_build_clib.py 2 Lib/distutils/tests/test_build_ext.py 16 Lib/distutils/tests/test_build_scripts.py 8 Lib/distutils/tests/test_clean.py 2 Lib/distutils/tests/test_config.py 2 Lib/distutils/tests/test_config_cmd.py 2 Lib/distutils/tests/test_install.py 2 Lib/distutils/tests/test_install_lib.py 2 Lib/distutils/tests/test_install_scripts.py 10 Lib/distutils/tests/test_msvc9compiler.py 6 Lib/distutils/tests/test_register.py 8 Lib/distutils/tests/test_sysconfig.py 2 Lib/distutils/tests/test_util.py 2

line wrap: on

line diff

--- a/Lib/distutils/tests/test_archive_util.py +++ b/Lib/distutils/tests/test_archive_util.py @@ -217,7 +217,7 @@ class ArchiveUtilTestCase(support.Tempdi dry_run=True) finally: os.chdir(old_dir)

@unittest.skipUnless(ZIP_SUPPORT and ZLIB_SUPPORT,

--- a/Lib/distutils/tests/test_bdist_rpm.py +++ b/Lib/distutils/tests/test_bdist_rpm.py @@ -81,7 +81,7 @@ class BuildRpmTestCase(support.TempdirMa cmd.run() dist_created = os.listdir(os.path.join(pkg_dir, 'dist'))

# bug #2945: upload ignores bdist_rpm files self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.src.rpm'), dist.dist_files) @@ -125,7 +125,7 @@ class BuildRpmTestCase(support.TempdirMa cmd.run() dist_created = os.listdir(os.path.join(pkg_dir, 'dist'))

# bug #2945: upload ignores bdist_rpm files self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.src.rpm'), dist.dist_files)

--- a/Lib/distutils/tests/test_bdist_wininst.py +++ b/Lib/distutils/tests/test_bdist_wininst.py @@ -22,7 +22,7 @@ class BuildWinInstTestCase(support.Tempd # and make sure it finds it and returns its content # no matter what platform we have exe_file = cmd.get_exe_bytes()

def test_suite(): return unittest.makeSuite(BuildWinInstTestCase)

--- a/Lib/distutils/tests/test_build_clib.py +++ b/Lib/distutils/tests/test_build_clib.py @@ -137,7 +137,7 @@ class BuildCLibTestCase(support.TempdirM cmd.run() # let's check the result

def test_suite(): return unittest.makeSuite(BuildCLibTestCase)

--- a/Lib/distutils/tests/test_build_ext.py +++ b/Lib/distutils/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)

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

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]

# setting a value cmd.user = 1 @@ -171,10 +171,10 @@ class BuildExtTestCase(TempdirManager, from distutils import sysconfig py_include = sysconfig.get_python_inc()

plat_py_include = sysconfig.get_python_inc(plat_specific=1)

# 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]

# 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')

# 'macros' element of build info dict must be 1- or 2-tuple exts = [('foo.bar', {'sources': [''], 'libraries': 'foo',

--- a/Lib/distutils/tests/test_build_scripts.py +++ b/Lib/distutils/tests/test_build_scripts.py @@ -17,8 +17,8 @@ class BuildScriptsTestCase(support.Tempd def test_default_settings(self): cmd = self.get_build_scripts_cmd("/foo/bar", [])

cmd.finalize_options() @@ -38,7 +38,7 @@ class BuildScriptsTestCase(support.Tempd built = os.listdir(target) for name in expected:

def get_build_scripts_cmd(self, target, scripts): import sys @@ -103,7 +103,7 @@ class BuildScriptsTestCase(support.Tempd built = os.listdir(target) for name in expected:

def test_suite(): return unittest.makeSuite(BuildScriptsTestCase)

--- a/Lib/distutils/tests/test_clean.py +++ b/Lib/distutils/tests/test_clean.py @@ -36,7 +36,7 @@ class cleanTestCase(support.TempdirManag # make sure the files where removed for name, path in dirs:

# let's run the command again (should spit warnings but succeed)

--- a/Lib/distutils/tests/test_config.py +++ b/Lib/distutils/tests/test_config.py @@ -103,7 +103,7 @@ class PyPIRCCommandTestCase(support.Temp def test_server_empty_registration(self): cmd = self._cmd(self.dist) rc = cmd._get_rc_file()

--- a/Lib/distutils/tests/test_config_cmd.py +++ b/Lib/distutils/tests/test_config_cmd.py @@ -81,7 +81,7 @@ class ConfigTestCase(support.LoggingSile cmd._clean(f1, f2) for f in (f1, f2):

def test_suite(): return unittest.makeSuite(ConfigTestCase)

--- a/Lib/distutils/tests/test_install.py +++ b/Lib/distutils/tests/test_install.py @@ -236,7 +236,7 @@ class InstallTestCase(support.TempdirMan self.test_record() finally: install_module.DEBUG = False

def test_suite():

--- a/Lib/distutils/tests/test_install_lib.py +++ b/Lib/distutils/tests/test_install_lib.py @@ -105,7 +105,7 @@ class InstallLibTestCase(support.Tempdir finally: sys.dont_write_bytecode = old_dont_write_bytecode

def test_suite():

--- a/Lib/distutils/tests/test_install_scripts.py +++ b/Lib/distutils/tests/test_install_scripts.py @@ -24,10 +24,10 @@ class InstallScriptsTestCase(support.Tem skip_build=1, ) cmd = install_scripts(dist)

cmd.finalize_options() @@ -72,7 +72,7 @@ class InstallScriptsTestCase(support.Tem installed = os.listdir(target) for name in expected:

def test_suite():

--- a/Lib/distutils/tests/test_msvc9compiler.py +++ b/Lib/distutils/tests/test_msvc9compiler.py @@ -128,7 +128,7 @@ class msvc9compilerTestCase(support.Temp # windows registeries versions. path = r'Control Panel\Desktop' v = Reg.get_value(path, 'dragfullwindows')

import winreg HKCU = winreg.HKEY_CURRENT_USER @@ -136,7 +136,7 @@ class msvc9compilerTestCase(support.Temp self.assertEqual(keys, None) keys = Reg.read_keys(HKCU, r'Control Panel')

def test_remove_visual_c_ref(self): from distutils.msvc9compiler import MSVCCompiler @@ -174,7 +174,7 @@ class msvc9compilerTestCase(support.Temp compiler = MSVCCompiler() got = compiler._remove_visual_c_ref(manifest)

def test_suite():

--- a/Lib/distutils/tests/test_register.py +++ b/Lib/distutils/tests/test_register.py @@ -98,7 +98,7 @@ class RegisterTestCase(PyPIRCCommandTest cmd = self._get_cmd() # we shouldn't have a .pypirc file yet

# patching input and getpass.getpass # so register gets happy @@ -145,7 +145,7 @@ class RegisterTestCase(PyPIRCCommandTest self.assertEqual(req1['Content-length'], '1374') self.assertEqual(req2['Content-length'], '1374')

def test_password_not_in_file(self): @@ -175,7 +175,7 @@ class RegisterTestCase(PyPIRCCommandTest req = self.conn.reqs[0] headers = dict(req.headers) self.assertEqual(headers['Content-length'], '608')

def test_password_reset(self): # this test runs choice 3 @@ -193,7 +193,7 @@ class RegisterTestCase(PyPIRCCommandTest req = self.conn.reqs[0] headers = dict(req.headers) self.assertEqual(headers['Content-length'], '290')

@unittest.skipUnless(docutils is not None, 'needs docutils') def test_strict(self):

--- a/Lib/distutils/tests/test_sysconfig.py +++ b/Lib/distutils/tests/test_sysconfig.py @@ -50,7 +50,7 @@ class SysconfigTestCase(support.EnvironG def test_get_config_vars(self): cvars = sysconfig.get_config_vars()

def test_srcdir(self):

--- a/Lib/distutils/tests/test_util.py +++ b/Lib/distutils/tests/test_util.py @@ -266,7 +266,7 @@ class UtilTestCase(support.EnvironGuard, self.assertTrue(strtobool(y)) for n in no:

def test_rfc822_escape(self): header = 'I am a\npoor\nlonesome\nheader\n'