def test_time():
    'Test date validation.'
    schema = vol.Schema(cv.time)
    for value in ['Not a time', '2016-11-23', '2016-11-23T18:59:08']:
        with pytest.raises(vol.Invalid):
            schema(value)
    schema(datetime.now().time())
    schema('23:42:00')
    schema('23:42')
Test date validation.
def test_time():
    
    schema = vol.Schema(cv.time)
    for value in ['Not a time', '2016-11-23', '2016-11-23T18:59:08']:
        with pytest.raises(vol.Invalid):
            schema(value)
    schema(datetime.now().time())
    schema('23:42:00')
    schema('23:42')