diff options
Diffstat (limited to 'Lib/packaging/tests')
-rw-r--r-- | Lib/packaging/tests/test_command_bdist_dumb.py | 2 | ||||
-rw-r--r-- | Lib/packaging/tests/test_command_build_ext.py | 11 | ||||
-rw-r--r-- | Lib/packaging/tests/test_command_register.py | 2 | ||||
-rw-r--r-- | Lib/packaging/tests/test_dist.py | 6 | ||||
-rw-r--r-- | Lib/packaging/tests/test_metadata.py | 4 |
5 files changed, 12 insertions, 13 deletions
diff --git a/Lib/packaging/tests/test_command_bdist_dumb.py b/Lib/packaging/tests/test_command_bdist_dumb.py index cc03fa5..8e2d497 100644 --- a/Lib/packaging/tests/test_command_bdist_dumb.py +++ b/Lib/packaging/tests/test_command_bdist_dumb.py @@ -35,7 +35,7 @@ class BuildDumbTestCase(support.TempdirManager, dist = Distribution({'name': 'foo', 'version': '0.1', 'py_modules': ['foo'], - 'home-page': 'xxx', 'author': 'xxx', + 'home_page': 'xxx', 'author': 'xxx', 'author_email': 'xxx'}) os.chdir(pkg_dir) cmd = bdist_dumb(dist) diff --git a/Lib/packaging/tests/test_command_build_ext.py b/Lib/packaging/tests/test_command_build_ext.py index c84631c..2926c37 100644 --- a/Lib/packaging/tests/test_command_build_ext.py +++ b/Lib/packaging/tests/test_command_build_ext.py @@ -4,14 +4,13 @@ import site import sysconfig import textwrap from io import StringIO -from sysconfig import _CONFIG_VARS from packaging.dist import Distribution from packaging.errors import (UnknownFileError, CompileError, PackagingPlatformError) from packaging.command.build_ext import build_ext from packaging.compiler.extension import Extension -from test.script_helper import assert_python_ok +from test.script_helper import assert_python_ok from packaging.tests import support, unittest, verbose @@ -75,16 +74,16 @@ class BuildExtTestCase(support.TempdirManager, sys.platform = 'sunos' # fooling finalize_options - old_var = _CONFIG_VARS.get('Py_ENABLE_SHARED') - _CONFIG_VARS['Py_ENABLE_SHARED'] = 1 + old_var = sysconfig.get_config_var('Py_ENABLE_SHARED') + sysconfig._CONFIG_VARS['Py_ENABLE_SHARED'] = 1 try: cmd.ensure_finalized() finally: sys.platform = old if old_var is None: - del _CONFIG_VARS['Py_ENABLE_SHARED'] + del sysconfig._CONFIG_VARS['Py_ENABLE_SHARED'] else: - _CONFIG_VARS['Py_ENABLE_SHARED'] = old_var + sysconfig._CONFIG_VARS['Py_ENABLE_SHARED'] = old_var # make sure we get some library dirs under solaris self.assertGreater(len(cmd.library_dirs), 0) diff --git a/Lib/packaging/tests/test_command_register.py b/Lib/packaging/tests/test_command_register.py index 9c64e2d..9872e2e 100644 --- a/Lib/packaging/tests/test_command_register.py +++ b/Lib/packaging/tests/test_command_register.py @@ -99,7 +99,7 @@ class RegisterTestCase(support.TempdirManager, def _get_cmd(self, metadata=None): if metadata is None: - metadata = {'home-page': 'xxx', 'author': 'xxx', + metadata = {'home_page': 'xxx', 'author': 'xxx', 'author_email': 'xxx', 'name': 'xxx', 'version': 'xxx'} pkg_info, dist = self.create_dist(**metadata) diff --git a/Lib/packaging/tests/test_dist.py b/Lib/packaging/tests/test_dist.py index 8d91a92..f912c6f 100644 --- a/Lib/packaging/tests/test_dist.py +++ b/Lib/packaging/tests/test_dist.py @@ -72,7 +72,7 @@ class DistributionTestCase(support.TempdirManager, Distribution(attrs={'author': 'xxx', 'name': 'xxx', 'version': '1.2', - 'home-page': 'xxxx', + 'home_page': 'xxxx', 'badoptname': 'xxx'}) logs = self.get_logs(logging.WARNING) self.assertEqual(len(logs), 1) @@ -82,7 +82,7 @@ class DistributionTestCase(support.TempdirManager, # an empty options dictionary should not stay in the # list of attributes dist = Distribution(attrs={'author': 'xxx', 'name': 'xxx', - 'version': '1.2', 'home-page': 'xxxx', + 'version': '1.2', 'home_page': 'xxxx', 'options': {}}) self.assertEqual([], self.get_logs(logging.WARNING)) @@ -99,7 +99,7 @@ class DistributionTestCase(support.TempdirManager, dist = Distribution(attrs={'author': 'xxx', 'name': 'xxx', 'version': 'xxx', - 'home-page': 'xxxx', + 'home_page': 'xxxx', 'options': {'sdist': {'owner': 'root'}}}) self.assertIn('owner', dist.get_option_dict('sdist')) diff --git a/Lib/packaging/tests/test_metadata.py b/Lib/packaging/tests/test_metadata.py index 68b3d97..6b7dd38 100644 --- a/Lib/packaging/tests/test_metadata.py +++ b/Lib/packaging/tests/test_metadata.py @@ -101,7 +101,7 @@ class MetadataTestCase(LoggingCatcher, # XXX caveat: the keys method and friends are not 3.x-style views # should be changed or documented - self.assertEqual(list(metadata), list(metadata.keys())) + self.assertEqual(list(metadata), metadata.keys()) def test_read_metadata(self): fields = {'name': 'project', @@ -301,7 +301,7 @@ class MetadataTestCase(LoggingCatcher, Metadata(mapping={'author': 'xxx', 'name': 'xxx', 'version': 'xxx', - 'home-page': 'xxxx'}) + 'home_page': 'xxxx'}) logs = self.get_logs(logging.WARNING) self.assertEqual(1, len(logs)) self.assertIn('not a valid version', logs[0]) |