Lines Matching refs:expected_regex
167 def __init__(self, expected, test_case, expected_regex=None): argument
171 if expected_regex is not None:
172 expected_regex = re.compile(expected_regex)
173 self.expected_regex = expected_regex
234 if self.expected_regex is None:
237 expected_regex = self.expected_regex
238 if not expected_regex.search(str(exc_value)):
240 expected_regex.pattern, str(exc_value)))
279 if (self.expected_regex is not None and
280 not self.expected_regex.search(str(w))):
290 self.expected_regex.pattern, str(first_matching)))
1262 def assertRaisesRegex(self, expected_exception, expected_regex, argument
1275 context = _AssertRaisesContext(expected_exception, self, expected_regex)
1278 def assertWarnsRegex(self, expected_warning, expected_regex, argument
1294 context = _AssertWarnsContext(expected_warning, self, expected_regex)
1297 def assertRegex(self, text, expected_regex, msg=None): argument
1299 if isinstance(expected_regex, (str, bytes)):
1300 assert expected_regex, "expected_regex must not be empty."
1301 expected_regex = re.compile(expected_regex)
1302 if not expected_regex.search(text):
1304 expected_regex.pattern, text)