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

Unified Diff: Lib/test/test_traceback.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_time.py ('k') | Lib/test/test_trace.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_traceback.py Fri Feb 07 17:53:13 2014 +0100
+++ b/Lib/test/test_traceback.py Fri Feb 07 23:40:05 2014 +0200
@@ -41,7 +41,7 @@
err = self.get_exception_format(self.syntax_error_with_caret,
SyntaxError)
self.assertEqual(len(err), 4)
- self.assertTrue(err[1].strip() == "return x!")
+ self.assertEqual(err[1].strip(), "return x!")
self.assertIn("^", err[2]) # third line has caret
self.assertEqual(err[1].find("!"), err[2].find("^")) # in the right place
@@ -148,7 +148,7 @@
self.assertTrue(stdout[2].endswith(err_line),
"Invalid traceback line: {0!r} instead of {1!r}".format(
stdout[2], err_line))
- self.assertTrue(stdout[3] == err_msg,
+ self.assertEqual(stdout[3], err_msg,
"Invalid error message: {0!r} instead of {1!r}".format(
stdout[3], err_msg))
« no previous file with comments | « Lib/test/test_time.py ('k') | Lib/test/test_trace.py » ('j') | no next file with comments »

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