[Python-checkins] distutils2: Don?t use a deprecated name

tarek.ziade python-checkins at python.org
Sun Dec 26 14:21:45 CET 2010


tarek.ziade pushed 7e42c35dd942 to distutils2:

http://hg.python.org/distutils2/rev/7e42c35dd942
changeset:   847:7e42c35dd942
user:        ?ric Araujo <merwok at netwok.org>
date:        Thu Dec 09 07:44:59 2010 +0100
summary:
  Don?t use a deprecated name

files:
  distutils2/tests/test_command_sdist.py
  distutils2/tests/test_config.py
  distutils2/tests/test_install.py
  distutils2/tests/test_metadata.py
  distutils2/tests/test_mixin2to3.py
  distutils2/tests/test_util.py
  distutils2/tests/test_version.py

diff --git a/distutils2/tests/test_command_sdist.py b/distutils2/tests/test_command_sdist.py
--- a/distutils2/tests/test_command_sdist.py
+++ b/distutils2/tests/test_command_sdist.py
@@ -363,7 +363,7 @@
         finally:
             f.close()
 
-        self.assertEquals(len(manifest), 4)
+        self.assertEqual(len(manifest), 4)
 
         # adding a file
         self.write_file((self.tmp_dir, 'somecode', 'doc2.txt'), '#')
@@ -383,7 +383,7 @@
             f.close()
 
         # do we have the new file in MANIFEST ?
-        self.assertEquals(len(manifest2), 5)
+        self.assertEqual(len(manifest2), 5)
         self.assertIn('doc2.txt', manifest2[-1])
 
     def test_manifest_marker(self):
diff --git a/distutils2/tests/test_config.py b/distutils2/tests/test_config.py
--- a/distutils2/tests/test_config.py
+++ b/distutils2/tests/test_config.py
@@ -204,7 +204,7 @@
                          'FooBarBazTest')
 
         # did the README got loaded ?
-        self.assertEquals(dist.metadata['description'], 'yeah')
+        self.assertEqual(dist.metadata['description'], 'yeah')
 
         # do we have the D Compiler enabled ?
         from distutils2.compiler import new_compiler, _COMPILERS
@@ -238,7 +238,7 @@
         finally:
             sys.argv[:] = old_sys
 
-        self.assertEquals(dist.foo_was_here, 1)
+        self.assertEqual(dist.foo_was_here, 1)
 
 
 def test_suite():
diff --git a/distutils2/tests/test_install.py b/distutils2/tests/test_install.py
--- a/distutils2/tests/test_install.py
+++ b/distutils2/tests/test_install.py
@@ -284,7 +284,7 @@
         install.install_from_infos(install=to_install,
                                          install_path=install_path)
         for dist in to_install:
-            self.assertEquals(dist.install_called_with, (install_path,))
+            self.assertEqual(dist.install_called_with, (install_path,))
 
 def test_suite():
     suite = unittest.TestSuite()
diff --git a/distutils2/tests/test_metadata.py b/distutils2/tests/test_metadata.py
--- a/distutils2/tests/test_metadata.py
+++ b/distutils2/tests/test_metadata.py
@@ -117,7 +117,7 @@
         metadata['Name'] = "baz; sys.platform == 'blah'"
         # FIXME is None or 'UNKNOWN' correct here?
         # where is that documented?
-        self.assertEquals(metadata['Name'], None)
+        self.assertEqual(metadata['Name'], None)
 
         # test with context
         context = {'sys.platform': 'okook'}
diff --git a/distutils2/tests/test_mixin2to3.py b/distutils2/tests/test_mixin2to3.py
--- a/distutils2/tests/test_mixin2to3.py
+++ b/distutils2/tests/test_mixin2to3.py
@@ -25,7 +25,7 @@
         converted_code_content = "print('test')\n"
         new_code_content = "".join(open(code_name).readlines())
 
-        self.assertEquals(new_code_content, converted_code_content)
+        self.assertEqual(new_code_content, converted_code_content)
 
     @unittest.skipIf(sys.version < '2.6', 'requires Python 2.6 or higher')
     def test_doctests_only(self):
@@ -45,7 +45,7 @@
         converted_doctest_content = '\n'.join(converted_doctest_content)
         new_doctest_content = "".join(open(doctest_name).readlines())
 
-        self.assertEquals(new_doctest_content, converted_doctest_content)
+        self.assertEqual(new_doctest_content, converted_doctest_content)
 
     @unittest.skipIf(sys.version < '2.6', 'requires Python 2.6 or higher')
     def test_additional_fixers(self):
@@ -64,7 +64,7 @@
                             fixers=['distutils2.tests.fixer'])
         converted_code_content = "isinstance(x, T)"
         new_code_content = "".join(open(code_name).readlines())
-        self.assertEquals(new_code_content, converted_code_content)
+        self.assertEqual(new_code_content, converted_code_content)
 
 def test_suite():
     return unittest.makeSuite(Mixin2to3TestCase)
diff --git a/distutils2/tests/test_util.py b/distutils2/tests/test_util.py
--- a/distutils2/tests/test_util.py
+++ b/distutils2/tests/test_util.py
@@ -144,7 +144,7 @@
         os.path.join = _join
 
         self.assertEqual(convert_path('/home/to/my/stuff'),
-                          '/home/to/my/stuff')
+                         '/home/to/my/stuff')
 
         # win
         os.sep = '\\'
@@ -156,9 +156,9 @@
         self.assertRaises(ValueError, convert_path, 'home/to/my/stuff/')
 
         self.assertEqual(convert_path('home/to/my/stuff'),
-                          'home\\to\\my\\stuff')
+                         'home\\to\\my\\stuff')
         self.assertEqual(convert_path('.'),
-                          os.curdir)
+                         os.curdir)
 
     def test_change_root(self):
         # linux/mac
@@ -171,9 +171,9 @@
         os.path.join = _join
 
         self.assertEqual(change_root('/root', '/old/its/here'),
-                          '/root/old/its/here')
+                         '/root/old/its/here')
         self.assertEqual(change_root('/root', 'its/here'),
-                          '/root/its/here')
+                         '/root/its/here')
 
         # windows
         os.name = 'nt'
@@ -190,9 +190,9 @@
         os.path.join = _join
 
         self.assertEqual(change_root('c:\\root', 'c:\\old\\its\\here'),
-                          'c:\\root\\old\\its\\here')
+                         'c:\\root\\old\\its\\here')
         self.assertEqual(change_root('c:\\root', 'its\\here'),
-                          'c:\\root\\its\\here')
+                         'c:\\root\\its\\here')
 
         # BugsBunny os (it's a great os)
         os.name = 'BugsBunny'
@@ -203,7 +203,7 @@
 
     def test_split_quoted(self):
         self.assertEqual(split_quoted('""one"" "two" \'three\' \\four'),
-                          ['one', 'two', 'three', 'four'])
+                         ['one', 'two', 'three', 'four'])
 
     def test_strtobool(self):
         yes = ('y', 'Y', 'yes', 'True', 't', 'true', 'True', 'On', 'on', '1')
@@ -383,7 +383,7 @@
         run_2to3([file_name])
         new_content = "".join(file_handle.read())
         file_handle.close()
-        self.assertEquals(new_content, converted_content)
+        self.assertEqual(new_content, converted_content)
 
     @unittest.skipIf(sys.version < '2.6', 'requires Python 2.6 or higher')
     def test_run_2to3_on_doctests(self):
@@ -399,7 +399,7 @@
         run_2to3([file_name], doctests_only=True)
         new_content = "".join(file_handle.readlines())
         file_handle.close()
-        self.assertEquals(new_content, converted_content)
+        self.assertEqual(new_content, converted_content)
 
     def test_nt_quote_args(self):
 
diff --git a/distutils2/tests/test_version.py b/distutils2/tests/test_version.py
--- a/distutils2/tests/test_version.py
+++ b/distutils2/tests/test_version.py
@@ -61,9 +61,9 @@
 
     def test_huge_version(self):
 
-        self.assertEquals(str(V('1980.0')), '1980.0')
+        self.assertEqual(str(V('1980.0')), '1980.0')
         self.assertRaises(HugeMajorVersionNumError, V, '1981.0')
-        self.assertEquals(str(V('1981.0', error_on_huge_major_num=False)), '1981.0')
+        self.assertEqual(str(V('1981.0', error_on_huge_major_num=False)), '1981.0')
 
     def test_comparison(self):
         r"""
@@ -225,7 +225,7 @@
     def test_parse_numdots(self):
         # For code coverage completeness, as pad_zeros_length can't be set or
         # influenced from the public interface
-        self.assertEquals(V('1.0')._parse_numdots('1.0', '1.0',
+        self.assertEqual(V('1.0')._parse_numdots('1.0', '1.0',
                                                   pad_zeros_length=3),
                           [1, 0, 0])
 

--
Repository URL: http://hg.python.org/distutils2


More information about the Python-checkins mailing list