def test_match_validator_invalid_match(): with pytest.raises(TypeError): # floats is neither a string nor anything 'matchable' validators.match_validator(123123.123)
def test_match_validator(match): validator = validators.match_validator(match) assert validator('foo1980') is None with pytest.raises(ValueError): validator('bar')