summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_grammar.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-06-30 23:06:06 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-06-30 23:06:06 (GMT)
commitc9c0f201fed21efcf669dbbf5f923eaf0eeb1db9 (patch)
tree6350dab0b481e6de307dc4e043c6230f463a9ca7 /Lib/test/test_grammar.py
parent98d23f2e065713ccfbc07d9a0b65f737a212bfb5 (diff)
downloadcpython-c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9.zip
cpython-c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9.tar.gz
cpython-c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9.tar.bz2
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