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

Unified Diff: Lib/test/test_inspect.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_hmac.py ('k') | Lib/test/test_iter.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_inspect.py Fri Feb 07 17:53:13 2014 +0100
+++ b/Lib/test/test_inspect.py Fri Feb 07 23:40:05 2014 +0200
@@ -169,7 +169,7 @@
self.istest(inspect.isframe, 'mod.fr')
def test_stack(self):
- self.assertTrue(len(mod.st) >= 5)
+ self.assertGreaterEqual(len(mod.st), 5)
self.assertEqual(revise(*mod.st[0][1:]),
(modfile, 16, 'eggs', [' st = inspect.stack()\n'], 0))
self.assertEqual(revise(*mod.st[1][1:]),
@@ -2381,7 +2381,7 @@
sig = inspect.signature(test)
sig = sig.replace(return_annotation=None)
- self.assertIs(sig.return_annotation, None)
+ self.assertIsNone(sig.return_annotation)
sig = sig.replace(return_annotation=sig.empty)
self.assertIs(sig.return_annotation, sig.empty)
sig = sig.replace(return_annotation=42)
@@ -2396,7 +2396,7 @@
P.VAR_POSITIONAL < P.KEYWORD_ONLY < P.VAR_KEYWORD)
self.assertEqual(str(P.POSITIONAL_ONLY), 'POSITIONAL_ONLY')
- self.assertTrue('POSITIONAL_ONLY' in repr(P.POSITIONAL_ONLY))
+ self.assertIn('POSITIONAL_ONLY', repr(P.POSITIONAL_ONLY))
def test_signature_parameter_object(self):
p = inspect.Parameter('foo', default=10,
@@ -2472,7 +2472,7 @@
p2 = p2.replace(name=p2.empty)
p2 = p2.replace(name='foo', default=None)
- self.assertIs(p2.default, None)
+ self.assertIsNone(p2.default)
self.assertNotEqual(p2, p)
p2 = p2.replace(name='foo', default=p2.empty)
« no previous file with comments | « Lib/test/test_hmac.py ('k') | Lib/test/test_iter.py » ('j') | no next file with comments »

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