def test_validate_callbacks_raises(): callbacks = [Logger(), SplineRegularizer(), 'not a callback'] with pytest.raises(TypeError) as excinfo: validate_callbacks(callbacks) err_msg = 'Found non-callback object in callbacks: {}'.format( ['not a callback']) assert err_msg == str(excinfo.value)
def test_validate_empty_callbacks(): assert validate_callbacks(None) == []
def test_validate_callbacks_single_callback(callback): validate_callbacks(callback) == [callback]
def test_validate_callbacks(): callbacks = [Logger(), SplineRegularizer()] assert validate_callbacks(callbacks) == callbacks