

def assert_raises_regexp(exception, reg, run, *args, **kwargs):
    'Like assertRaisesRegexp in unittest'
    __tracebackhide__ = True
    try:
        p(*args, **kwargs)
        assert False, ('%s should have been thrown' % exception)
    except exception:
        e = sys.exc_info()[1]
        p = re.compile(reg)
        assert p.search(str(e)), str(e)

dataset/ETHPy150Open pypa/pip/tests/lib/__init__.py assert_raises_regexp/VarMisuse@30/47 `run`->`p`