From 46dfc2aad26fc747b4251c409c6e718eb756b858 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Fri, 7 Sep 2012 10:45:27 -0400 Subject: unittests: define assertNotRegexpMatches separately from assertRegexpMatches --- testsuite/common.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'testsuite/common.py') diff --git a/testsuite/common.py b/testsuite/common.py index 82a15b71b..fc79e73e7 100644 --- a/testsuite/common.py +++ b/testsuite/common.py @@ -164,6 +164,11 @@ class Bcfg2TestCase(unittest.TestCase): # assertRegexpMatches, but have the other convenience methods. assertRegexpMatches = _assertion(lambda s, r: _regex_matches(s, r), "%s does not contain /%s/") + + if not hasattr(unittest.TestCase, "assertNotRegexpMatches"): + # Some versions of TestCase in Py3k seem to lack + # assertNotRegexpMatches even though they have + # assertRegexpMatches assertNotRegexpMatches = \ _assertion(lambda s, r: not _regex_matches(s, r), "%s contains /%s/") -- cgit v1.2.3-1-g7c22