diff options
Diffstat (limited to 'Lib/unittest/test/test_case.py')
-rw-r--r-- | Lib/unittest/test/test_case.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/unittest/test/test_case.py b/Lib/unittest/test/test_case.py index d171451..b8cb0c7 100644 --- a/Lib/unittest/test/test_case.py +++ b/Lib/unittest/test/test_case.py @@ -307,7 +307,7 @@ class Test_TestCase(unittest.TestCase, TestEquality, TestHashing): def test(self): pass - self.assertTrue(Foo('test').failureException is AssertionError) + self.assertIs(Foo('test').failureException, AssertionError) # "This class attribute gives the exception raised by the test() method. # If a test framework needs to use a specialized exception, possibly to @@ -325,7 +325,7 @@ class Test_TestCase(unittest.TestCase, TestEquality, TestHashing): failureException = RuntimeError - self.assertTrue(Foo('test').failureException is RuntimeError) + self.assertIs(Foo('test').failureException, RuntimeError) Foo('test').run(result) @@ -348,7 +348,7 @@ class Test_TestCase(unittest.TestCase, TestEquality, TestHashing): failureException = RuntimeError - self.assertTrue(Foo('test').failureException is RuntimeError) + self.assertIs(Foo('test').failureException, RuntimeError) Foo('test').run(result) @@ -660,7 +660,7 @@ class Test_TestCase(unittest.TestCase, TestEquality, TestHashing): msg = e.args[0] else: self.fail('assertSequenceEqual did not fail.') - self.assertTrue(len(msg) < len(diff)) + self.assertLess(len(msg), len(diff)) self.assertIn(omitted, msg) self.maxDiff = len(diff) * 2 @@ -670,7 +670,7 @@ class Test_TestCase(unittest.TestCase, TestEquality, TestHashing): msg = e.args[0] else: self.fail('assertSequenceEqual did not fail.') - self.assertTrue(len(msg) > len(diff)) + self.assertGreater(len(msg), len(diff)) self.assertNotIn(omitted, msg) self.maxDiff = None @@ -680,7 +680,7 @@ class Test_TestCase(unittest.TestCase, TestEquality, TestHashing): msg = e.args[0] else: self.fail('assertSequenceEqual did not fail.') - self.assertTrue(len(msg) > len(diff)) + self.assertGreater(len(msg), len(diff)) self.assertNotIn(omitted, msg) def testTruncateMessage(self): |