def no_match(s): match = url_re.search(s) if match: assert not match, 'matched %s' % s[slice(*match.span())]
def no_match(s): match = url_re.search(s) if match: assert not match, 'matched {0!s}'.format(s[slice(*match.span())])
def test_url_re(): text = 'just what i am looking for...it' match = url_re.search(text) assert not match, 'matched {0!s}'.format(text[slice(*match.span())])