diff options
author | Jonathan Vanasco <jonathan@2xlp.com> | 2020-01-08 22:42:39 -0500 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2020-01-08 19:42:39 -0800 |
commit | 10a2b75b8be7b68eacfa168834d9938b77d2d7e3 (patch) | |
tree | b432f365a335b5d66e90e8af5b2156deb84e00b8 /test_six.py | |
parent | 5cd83db203a9f4bffd401e77a48543669548a94e (diff) | |
download | six-git-10a2b75b8be7b68eacfa168834d9938b77d2d7e3.tar.gz |
Add assertNotRegex. (#289)
Fixes #288.
Co-authored-by: Benjamin Peterson <benjamin@python.org>
Diffstat (limited to 'test_six.py')
-rw-r--r-- | test_six.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test_six.py b/test_six.py index 2cd2112..7b8b03b 100644 --- a/test_six.py +++ b/test_six.py @@ -938,6 +938,17 @@ def test_assertRegex(): TestAssertRegex('test').test() +def test_assertNotRegex(): + class TestAssertNotRegex(unittest.TestCase): + def test(self): + with self.assertRaises(AssertionError): + six.assertNotRegex(self, 'test', r'^t') + + six.assertNotRegex(self, 'test', r'^a') + + TestAssertNotRegex('test').test() + + def test_assertRaisesRegex(): class TestAssertRaisesRegex(unittest.TestCase): def test(self): |