summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_grammar.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-08-13 08:51:18 (GMT)
committerGeorg Brandl <georg@python.org>2009-08-13 08:51:18 (GMT)
commitab91fdef1f1e556203a2eee98ba7d379e4790de9 (patch)
tree6f8f00dc18cc5f2801a675df277c2c595eb85ec8 /Lib/test/test_grammar.py
parentef82be368abdea8e8032500e7ecc3a22f5f07851 (diff)
downloadcpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.zip
cpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.tar.gz
cpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.tar.bz2
Merged revisions 73715 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k ........ r73715 | benjamin.peterson | 2009-07-01 01:06:06 +0200 (Mi, 01 Jul 2009) | 1 line convert old fail* assertions to assert* ........
Diffstat (limited to 'Lib/test/test_grammar.py')
-rw-r--r--Lib/test/test_grammar.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py
index 977f0b8..b861207 100644
--- a/Lib/test/test_grammar.py
+++ b/Lib/test/test_grammar.py
@@ -38,9 +38,9 @@ class TokenTests(unittest.TestCase):
if maxsize == 2147483647:
self.assertEquals(-2147483647-1, -0o20000000000)
# XXX -2147483648
- self.assert_(0o37777777777 > 0)
- self.assert_(0xffffffff > 0)
- self.assert_(0b1111111111111111111111111111111 > 0)
+ self.assertTrue(0o37777777777 > 0)
+ self.assertTrue(0xffffffff > 0)
+ self.assertTrue(0b1111111111111111111111111111111 > 0)
for s in ('2147483648', '0o40000000000', '0x100000000',
'0b10000000000000000000000000000000'):
try:
@@ -49,9 +49,9 @@ class TokenTests(unittest.TestCase):
self.fail("OverflowError on huge integer literal %r" % s)
elif maxsize == 9223372036854775807:
self.assertEquals(-9223372036854775807-1, -0o1000000000000000000000)
- self.assert_(0o1777777777777777777777 > 0)
- self.assert_(0xffffffffffffffff > 0)
- self.assert_(0b11111111111111111111111111111111111111111111111111111111111111 > 0)
+ self.assertTrue(0o1777777777777777777777 > 0)
+ self.assertTrue(0xffffffffffffffff > 0)
+ self.assertTrue(0b11111111111111111111111111111111111111111111111111111111111111 > 0)
for s in '9223372036854775808', '0o2000000000000000000000', \
'0x10000000000000000', \
'0b100000000000000000000000000000000000000000000000000000000000000':
@@ -87,15 +87,15 @@ class TokenTests(unittest.TestCase):
x = 3.1e4
def testStringLiterals(self):
- x = ''; y = ""; self.assert_(len(x) == 0 and x == y)
- x = '\''; y = "'"; self.assert_(len(x) == 1 and x == y and ord(x) == 39)
- x = '"'; y = "\""; self.assert_(len(x) == 1 and x == y and ord(x) == 34)
+ x = ''; y = ""; self.assertTrue(len(x) == 0 and x == y)
+ x = '\''; y = "'"; self.assertTrue(len(x) == 1 and x == y and ord(x) == 39)
+ x = '"'; y = "\""; self.assertTrue(len(x) == 1 and x == y and ord(x) == 34)
x = "doesn't \"shrink\" does it"
y = 'doesn\'t "shrink" does it'
- self.assert_(len(x) == 24 and x == y)
+ self.assertTrue(len(x) == 24 and x == y)
x = "does \"shrink\" doesn't it"
y = 'does "shrink" doesn\'t it'
- self.assert_(len(x) == 24 and x == y)
+ self.assertTrue(len(x) == 24 and x == y)
x = """
The "quick"
brown fox
@@ -128,7 +128,7 @@ the \'lazy\' dog.\n\
def testEllipsis(self):
x = ...
- self.assert_(x is Ellipsis)
+ self.assertTrue(x is Ellipsis)
self.assertRaises(SyntaxError, eval, ".. .")
class GrammarTests(unittest.TestCase):
@@ -494,7 +494,7 @@ class GrammarTests(unittest.TestCase):
nonlocal x, y
def testAssert(self):
- # assert_stmt: 'assert' test [',' test]
+ # assertTruestmt: 'assert' test [',' test]
assert 1
assert 1, 1
assert lambda x:x