diff options
| author | Benjamin Peterson <benjamin@python.org> | 2009-06-30 22:57:08 (GMT) |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2009-06-30 22:57:08 (GMT) |
| commit | 5c8da86f3a515ce1a6d5f27fd15e3c5f4d8e931e (patch) | |
| tree | 41f38aca16748628d53906337f06fdf087f52314 /Lib/test/test_grammar.py | |
| parent | be96cf608fa656d7e53144cf85082ed5661e8c13 (diff) | |
| download | cpython-5c8da86f3a515ce1a6d5f27fd15e3c5f4d8e931e.zip cpython-5c8da86f3a515ce1a6d5f27fd15e3c5f4d8e931e.tar.gz cpython-5c8da86f3a515ce1a6d5f27fd15e3c5f4d8e931e.tar.bz2 | |
convert usage of fail* to assert*
Diffstat (limited to 'Lib/test/test_grammar.py')
| -rw-r--r-- | Lib/test/test_grammar.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py index 17f9f4c..27966ed 100644 --- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -36,8 +36,8 @@ class TokenTests(unittest.TestCase): if maxint == 2147483647: self.assertEquals(-2147483647-1, -020000000000) # XXX -2147483648 - self.assert_(037777777777 > 0) - self.assert_(0xffffffff > 0) + self.assertTrue(037777777777 > 0) + self.assertTrue(0xffffffff > 0) for s in '2147483648', '040000000000', '0x100000000': try: x = eval(s) @@ -45,8 +45,8 @@ class TokenTests(unittest.TestCase): self.fail("OverflowError on huge integer literal %r" % s) elif maxint == 9223372036854775807: self.assertEquals(-9223372036854775807-1, -01000000000000000000000) - self.assert_(01777777777777777777777 > 0) - self.assert_(0xffffffffffffffff > 0) + self.assertTrue(01777777777777777777777 > 0) + self.assertTrue(0xffffffffffffffff > 0) for s in '9223372036854775808', '02000000000000000000000', \ '0x10000000000000000': try: @@ -81,15 +81,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 @@ -550,7 +550,7 @@ hello world self.fail('exec ... in g (%s), l (%s)' %(g,l)) def testAssert(self): - # assert_stmt: 'assert' test [',' test] + # assertTruestmt: 'assert' test [',' test] assert 1 assert 1, 1 assert lambda x:x |
