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

Unified Diff: Lib/test/test_functools.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_funcattrs.py ('k') | Lib/test/test_gc.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_functools.py Fri Feb 07 17:53:13 2014 +0100
+++ b/Lib/test/test_functools.py Fri Feb 07 23:40:05 2014 +0200
@@ -91,7 +91,8 @@
p = self.partial(capture, *args)
expected = args + ('x',)
got, empty = p('x')
- self.assertTrue(expected == got and empty == {})
+ self.assertEqual(got, expected)
+ self.assertEqual(empty, {})
def test_keyword(self):
# make sure keyword arguments are captured correctly
@@ -99,15 +100,18 @@
p = self.partial(capture, a=a)
expected = {'a':a,'x':None}
empty, got = p(x=None)
- self.assertTrue(expected == got and empty == ())
+ self.assertEqual(got, expected)
+ self.assertEqual(empty, ())
def test_no_side_effects(self):
# make sure there are no side effects that affect subsequent calls
p = self.partial(capture, 0, a=1)
args1, kw1 = p(1, b=2)
- self.assertTrue(args1 == (0,1) and kw1 == {'a':1,'b':2})
+ self.assertEqual(args1, (0,1))
+ self.assertEqual(kw1, {'a':1,'b':2})
args2, kw2 = p()
- self.assertTrue(args2 == (0,) and kw2 == {'a':1})
+ self.assertEqual(args2, (0,))
+ self.assertEqual(kw2, {'a':1})
def test_error_propagation(self):
def f(x, y):
@@ -898,7 +902,7 @@
expected = orig(x, y)
self.assertEqual(actual, expected)
hits, misses, maxsize, currsize = f.cache_info()
- self.assertTrue(hits > misses)
+ self.assertGreater(hits, misses)
self.assertEqual(hits + misses, 1000)
self.assertEqual(currsize, 20)
« no previous file with comments | « Lib/test/test_funcattrs.py ('k') | Lib/test/test_gc.py » ('j') | no next file with comments »

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