diff options
author | Guido van Rossum <guido@python.org> | 2007-07-11 12:20:59 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-07-11 12:20:59 (GMT) |
commit | e61fd5b5ed9d677da2f3349078d7f66f707199de (patch) | |
tree | e28a7630ed3c285eabc7631f4276a2b06e74682b /Lib/test/test_traceback.py | |
parent | c9b9de17976a4832f505309b1096f9a7582c7be9 (diff) | |
download | cpython-e61fd5b5ed9d677da2f3349078d7f66f707199de.zip cpython-e61fd5b5ed9d677da2f3349078d7f66f707199de.tar.gz cpython-e61fd5b5ed9d677da2f3349078d7f66f707199de.tar.bz2 |
Patch by Christian Heimes to change self.assert_(x == y) into
self.assertEqual(x, y). (Christian used self.failUnlessEqual(),
but the double negative makes it hard to grok, so I changed it.)
Diffstat (limited to 'Lib/test/test_traceback.py')
-rw-r--r-- | Lib/test/test_traceback.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py index 98d3beb..5cd300a 100644 --- a/Lib/test/test_traceback.py +++ b/Lib/test/test_traceback.py @@ -30,10 +30,10 @@ class TracebackCases(unittest.TestCase): def test_caret(self): err = self.get_exception_format(self.syntax_error_with_caret, SyntaxError) - self.assert_(len(err) == 4) + self.assertEqual(len(err), 4) self.assert_(err[1].strip() == "return x!") self.assert_("^" in err[2]) # third line has caret - self.assert_(err[1].find("!") == err[2].find("^")) # in the right place + self.assertEqual(err[1].find("!"), err[2].find("^")) # in the right place def test_nocaret(self): if is_jython: @@ -41,16 +41,16 @@ class TracebackCases(unittest.TestCase): return err = self.get_exception_format(self.syntax_error_without_caret, SyntaxError) - self.assert_(len(err) == 3) + self.assertEqual(len(err), 3) self.assert_(err[1].strip() == "[x for x in x] = x") def test_bad_indentation(self): err = self.get_exception_format(self.syntax_error_bad_indentation, IndentationError) - self.assert_(len(err) == 4) - self.assert_(err[1].strip() == "print(2)") + self.assertEqual(len(err), 4) + self.assertEqual(err[1].strip(), "print(2)") self.assert_("^" in err[2]) - self.assert_(err[1].find(")") == err[2].find("^")) + self.assertEqual(err[1].find(")"), err[2].find("^")) def test_members(self): # Covers Python/structmember.c::listmembers() |