summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_exceptions.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-11-21 13:34:58 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-11-21 13:34:58 (GMT)
commit2623a37852153363335956afab010cb0beb7e74e (patch)
treee443a19bb7a87adc2158ef2e32da5c2f3b21936c /Lib/test/test_exceptions.py
parent40a92f5c65767d80ebc3b3be2c2ccfc5db3afb7b (diff)
downloadcpython-2623a37852153363335956afab010cb0beb7e74e.zip
cpython-2623a37852153363335956afab010cb0beb7e74e.tar.gz
cpython-2623a37852153363335956afab010cb0beb7e74e.tar.bz2
Merged revisions 86596 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line #9424: Replace deprecated assert* methods in the Python test suite. ........
Diffstat (limited to 'Lib/test/test_exceptions.py')
-rw-r--r--Lib/test/test_exceptions.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index 3ee0856..a19c82d 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -32,8 +32,8 @@ class ExceptionTests(unittest.TestCase):
raise exc("spam")
except exc, err:
buf2 = str(err)
- self.assertEquals(buf1, buf2)
- self.assertEquals(exc.__name__, excname)
+ self.assertEqual(buf1, buf2)
+ self.assertEqual(exc.__name__, excname)
def testRaising(self):
self.raise_catch(AttributeError, "AttributeError")
@@ -163,7 +163,7 @@ class ExceptionTests(unittest.TestCase):
except TypeError, err:
exc, err, tb = sys.exc_info()
co = tb.tb_frame.f_code
- self.assertEquals(co.co_name, "test_capi1")
+ self.assertEqual(co.co_name, "test_capi1")
self.assertTrue(co.co_filename.endswith('test_exceptions'+os.extsep+'py'))
else:
self.fail("Expected exception")
@@ -175,10 +175,10 @@ class ExceptionTests(unittest.TestCase):
except RuntimeError, err:
exc, err, tb = sys.exc_info()
co = tb.tb_frame.f_code
- self.assertEquals(co.co_name, "__init__")
+ self.assertEqual(co.co_name, "__init__")
self.assertTrue(co.co_filename.endswith('test_exceptions'+os.extsep+'py'))
co2 = tb.tb_frame.f_back.f_code
- self.assertEquals(co2.co_name, "test_capi2")
+ self.assertEqual(co2.co_name, "test_capi2")
else:
self.fail("Expected exception")
@@ -284,14 +284,14 @@ class ExceptionTests(unittest.TestCase):
if type(e) is not exc:
raise
# Verify module name
- self.assertEquals(type(e).__module__, 'exceptions')
+ self.assertEqual(type(e).__module__, 'exceptions')
# Verify no ref leaks in Exc_str()
s = str(e)
for checkArgName in expected:
- self.assertEquals(repr(getattr(e, checkArgName)),
- repr(expected[checkArgName]),
- 'exception "%s", attribute "%s"' %
- (repr(e), checkArgName))
+ self.assertEqual(repr(getattr(e, checkArgName)),
+ repr(expected[checkArgName]),
+ 'exception "%s", attribute "%s"' %
+ (repr(e), checkArgName))
# test for pickling support
for p in pickle, cPickle:
@@ -300,9 +300,9 @@ class ExceptionTests(unittest.TestCase):
for checkArgName in expected:
got = repr(getattr(new, checkArgName))
want = repr(expected[checkArgName])
- self.assertEquals(got, want,
- 'pickled "%r", attribute "%s"' %
- (e, checkArgName))
+ self.assertEqual(got, want,
+ 'pickled "%r", attribute "%s"' %
+ (e, checkArgName))
def testDeprecatedMessageAttribute(self):
@@ -359,7 +359,7 @@ class ExceptionTests(unittest.TestCase):
self.fancy_arg = fancy_arg
x = DerivedException(fancy_arg=42)
- self.assertEquals(x.fancy_arg, 42)
+ self.assertEqual(x.fancy_arg, 42)
def testInfiniteRecursion(self):
def f():