summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/test/test_assertions.py
diff options
context:
space:
mode:
authorMichael Foord <fuzzyman@voidspace.org.uk>2010-04-02 22:55:59 (GMT)
committerMichael Foord <fuzzyman@voidspace.org.uk>2010-04-02 22:55:59 (GMT)
commita04c7a0f169caf09b181df05836e4cf175f37dbe (patch)
treea28694f608093b47a974b249cbb9ee22f1522d8f /Lib/unittest/test/test_assertions.py
parent25d7976014bdf4a96fa242a3f86ff3ffe5a514eb (diff)
downloadcpython-a04c7a0f169caf09b181df05836e4cf175f37dbe.zip
cpython-a04c7a0f169caf09b181df05836e4cf175f37dbe.tar.gz
cpython-a04c7a0f169caf09b181df05836e4cf175f37dbe.tar.bz2
Issue #8038: Addition of unittest.TestCase.assertNotRegexpMatches
Diffstat (limited to 'Lib/unittest/test/test_assertions.py')
-rw-r--r--Lib/unittest/test/test_assertions.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/unittest/test/test_assertions.py b/Lib/unittest/test/test_assertions.py
index 5d77ce8..1880059 100644
--- a/Lib/unittest/test/test_assertions.py
+++ b/Lib/unittest/test/test_assertions.py
@@ -91,6 +91,16 @@ class Test_Assertions(unittest.TestCase):
else:
self.fail("assertRaises() didn't let exception pass through")
+ def testAssertNotRegexpMatches(self):
+ self.assertNotRegexpMatches('Ala ma kota', r'r+')
+ try:
+ self.assertNotRegexpMatches('Ala ma kota', r'k.t', 'Message')
+ except self.failureException, e:
+ self.assertIn("'kot'", e.args[0])
+ self.assertIn('Message', e.args[0])
+ else:
+ self.fail('assertNotRegexpMatches should have failed.')
+
class TestLongMessage(unittest.TestCase):
"""Test that the individual asserts honour longMessage.