def checkRegex(self, text, expected_regex):
    if (sys.version_info < (3, 0)):
        return self.assertRegexpMatches(text, expected_regex)
    return self.assertRegex(text, expected_regex)
def checkRegex(self, text, expected_regex):
    if (sys.version_info < (3, 0)):
        return self.assertRegexpMatches(text, expected_regex)
    return self.assertRegex(text, expected_regex)