'Simulate re.compile showing a warning we don\'t know about yet.
The warning should be passed.'

@pytest.mark.parametrize('warning', [Warning('foo'), DeprecationWarning('foo')])
def test_passed_warnings(self, mocker, klass, warning):

    m = mocker.patch('qutebrowser.config.configtypes.re')
    m.compile.side_effect = (lambda *args: warnings.warn(warning))
    m.error = re.error
    with pytest.raises(type(warning)):
        klass().validate('foo')
