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)))
1277 def assertRaisesRegex(self, expected_exception, expected_regex, argument
1290 context = _AssertRaisesContext(expected_exception, self, expected_regex)
1293 def assertWarnsRegex(self, expected_warning, expected_regex, argument
1309 context = _AssertWarnsContext(expected_warning, self, expected_regex)
1312 def assertRegex(self, text, expected_regex, msg=None): argument
1314 if isinstance(expected_regex, (str, bytes)):
1315 assert expected_regex, "expected_regex must not be empty."
1316 expected_regex = re.compile(expected_regex)
1317 if not expected_regex.search(text):
1319 expected_regex.pattern, text)