summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/test/_test_warnings.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/unittest/test/_test_warnings.py')
-rw-r--r--Lib/unittest/test/_test_warnings.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/unittest/test/_test_warnings.py b/Lib/unittest/test/_test_warnings.py
index 08b846e..5cbfb53 100644
--- a/Lib/unittest/test/_test_warnings.py
+++ b/Lib/unittest/test/_test_warnings.py
@@ -18,6 +18,17 @@ def warnfun():
warnings.warn('rw', RuntimeWarning)
class TestWarnings(unittest.TestCase):
+ # unittest warnings will be printed at most once per type (max one message
+ # for the fail* methods, and one for the assert* methods)
+ def test_assert(self):
+ self.assertEquals(2+2, 4)
+ self.assertEquals(2*2, 4)
+ self.assertEquals(2**2, 4)
+
+ def test_fail(self):
+ self.failUnless(1)
+ self.failUnless(True)
+
def test_other_unittest(self):
self.assertAlmostEqual(2+2, 4)
self.assertNotAlmostEqual(4+4, 2)