[Python-checkins] cpython (merge 3.3 -> default): Issue #16793. Replace deprecated unittest asserts with modern counterparts.
serhiy.storchaka
python-checkins at python.org
Thu Dec 27 23:47:06 CET 2012
http://hg.python.org/cpython/rev/eb3a4ae095a8
changeset: 81111:eb3a4ae095a8
parent: 81108:9177d8e6e317
parent: 81110:6601818622ea
user: Serhiy Storchaka <storchaka at gmail.com>
date: Fri Dec 28 00:36:34 2012 +0200
summary:
Issue #16793. Replace deprecated unittest asserts with modern counterparts.
files:
Lib/test/test_int.py | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/Lib/test/test_int.py b/Lib/test/test_int.py
--- a/Lib/test/test_int.py
+++ b/Lib/test/test_int.py
@@ -226,23 +226,23 @@
self.assertIs(int(b'-1'), -1)
def test_no_args(self):
- self.assertEquals(int(), 0)
+ self.assertEqual(int(), 0)
def test_keyword_args(self):
# Test invoking int() using keyword arguments.
- self.assertEquals(int(x=1.2), 1)
- self.assertEquals(int('100', base=2), 4)
- self.assertEquals(int(x='100', base=2), 4)
+ self.assertEqual(int(x=1.2), 1)
+ self.assertEqual(int('100', base=2), 4)
+ self.assertEqual(int(x='100', base=2), 4)
# For example, PyPy 1.9.0 raised TypeError for these cases because it
# expects x to be a string if base is given.
@support.cpython_only
def test_base_arg_with_no_x_arg(self):
- self.assertEquals(int(base=6), 0)
+ self.assertEqual(int(base=6), 0)
# Even invalid bases don't raise an exception.
- self.assertEquals(int(base=1), 0)
- self.assertEquals(int(base=1000), 0)
- self.assertEquals(int(base='foo'), 0)
+ self.assertEqual(int(base=1), 0)
+ self.assertEqual(int(base=1000), 0)
+ self.assertEqual(int(base='foo'), 0)
def test_int_base_limits(self):
"""Testing the supported limits of the int() base parameter."""
@@ -283,8 +283,8 @@
for x in values:
msg = 'x has type %s' % type(x).__name__
- self.assertEquals(int(x), 100, msg=msg)
- self.assertEquals(int(x, 2), 4, msg=msg)
+ self.assertEqual(int(x), 100, msg=msg)
+ self.assertEqual(int(x, 2), 4, msg=msg)
def test_string_float(self):
self.assertRaises(ValueError, int, '1.2')
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list