summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_int.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2012-12-27 22:34:57 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2012-12-27 22:34:57 (GMT)
commita29159b07560f6484175769fd4d470948341ccce (patch)
treef5d7092f7565d7c966976c6afb79b841890bfa79 /Lib/test/test_int.py
parent1ef73d21a209ab48248db4fa75db523e803a9f19 (diff)
downloadcpython-a29159b07560f6484175769fd4d470948341ccce.zip
cpython-a29159b07560f6484175769fd4d470948341ccce.tar.gz
cpython-a29159b07560f6484175769fd4d470948341ccce.tar.bz2
Issue #16793. Replace deprecated unittest asserts with modern counterparts.
Diffstat (limited to 'Lib/test/test_int.py')
-rw-r--r--Lib/test/test_int.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/Lib/test/test_int.py b/Lib/test/test_int.py
index 225b520..52705de 100644
--- a/Lib/test/test_int.py
+++ b/Lib/test/test_int.py
@@ -226,23 +226,23 @@ class IntTestCases(unittest.TestCase):
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_non_numeric_input_types(self):
# Test possible non-numeric types for the argument x, including
@@ -259,8 +259,8 @@ class IntTestCases(unittest.TestCase):
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')