def test_is_regex():
    'Test the is_regex validator.'
    schema = vol.Schema(cv.is_regex)
    with pytest.raises(vol.Invalid):
        schema('(')
    with pytest.raises(vol.Invalid):
        schema({'a dict': 'is not a regex'})
    valid_re = '.*'
    schema(valid_re)
Test the is_regex validator.
def test_is_regex():
    
    schema = vol.Schema(cv.is_regex)
    with pytest.raises(vol.Invalid):
        schema('(')
    with pytest.raises(vol.Invalid):
        schema({'a dict': 'is not a regex'})
    valid_re = '.*'
    schema(valid_re)