Index: Doc/library/unittest.rst =================================================================== --- Doc/library/unittest.rst (revision 85983) +++ Doc/library/unittest.rst (working copy) @@ -147,6 +147,26 @@ These methods are used instead of the :keyword:`assert` statement so the test runner can accumulate all test results and produce a report. +The following table summarizes the most common assert* methods and what they +check: + +=========================================================================== ============================= +Method Checks that +=========================================================================== ============================= +:meth:`assertEqual(a, b) ` a == b +:meth:`assertNotEqual(a, b) ` a != b +:meth:`assertTrue(x) ` bool(x) is True +:meth:`assertFalse(x) ` bool(x) is False +:meth:`assertIs(a, b) ` a is b +:meth:`assertIsNot(a, b) ` a is not b +:meth:`assertIsNone(x) ` x is None +:meth:`assertIsNotNone(x) ` x is not None +:meth:`assertIn(a, b) ` a in b +:meth:`assertNotIn(a, b) ` a not in b +:meth:`assertIsInstance(a, b) ` isinstance(a, b) +:meth:`assertNotIsInstance(a, b) ` not isinstance(a, b) +=========================================================================== ============================= + When a :meth:`~TestCase.setUp` method is defined, the test runner will run that method prior to each test. Likewise, if a :meth:`~TestCase.tearDown` method is defined, the test runner will invoke that method after each test. In the