Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(93719)

Unified Diff: Lib/test/test_grammar.py

Issue 16510: Using appropriate checks in tests
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/test/test_gdb.py ('k') | Lib/test/test_gzip.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_grammar.py Fri Feb 07 17:53:13 2014 +0100
+++ b/Lib/test/test_grammar.py Fri Feb 07 23:40:05 2014 +0200
@@ -32,9 +32,9 @@
if maxsize == 2147483647:
self.assertEqual(-2147483647-1, -0o20000000000)
# XXX -2147483648
- self.assertTrue(0o37777777777 > 0)
- self.assertTrue(0xffffffff > 0)
- self.assertTrue(0b1111111111111111111111111111111 > 0)
+ self.assertGreater(0o37777777777, 0)
+ self.assertGreater(0xffffffff, 0)
+ self.assertGreater(0b1111111111111111111111111111111, 0)
for s in ('2147483648', '0o40000000000', '0x100000000',
'0b10000000000000000000000000000000'):
try:
@@ -43,9 +43,9 @@
self.fail("OverflowError on huge integer literal %r" % s)
elif maxsize == 9223372036854775807:
self.assertEqual(-9223372036854775807-1, -0o1000000000000000000000)
- self.assertTrue(0o1777777777777777777777 > 0)
- self.assertTrue(0xffffffffffffffff > 0)
- self.assertTrue(0b11111111111111111111111111111111111111111111111111111111111111 > 0)
+ self.assertGreater(0o1777777777777777777777, 0)
+ self.assertGreater(0xffffffffffffffff, 0)
+ self.assertGreater(0b11111111111111111111111111111111111111111111111111111111111111, 0)
for s in '9223372036854775808', '0o2000000000000000000000', \
'0x10000000000000000', \
'0b100000000000000000000000000000000000000000000000000000000000000':
@@ -122,7 +122,7 @@
def test_ellipsis(self):
x = ...
- self.assertTrue(x is Ellipsis)
+ self.assertIs(x, Ellipsis)
self.assertRaises(SyntaxError, eval, ".. .")
def test_eof_error(self):
« no previous file with comments | « Lib/test/test_gdb.py ('k') | Lib/test/test_gzip.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+