Model tests

Model tests check that a deployed model behaves as expected: the API responds with the right format, invalid inputs are rejected, predictions on known cases are stable and metrics stay above a threshold. They run automatically before every release to production.

Example

def test_predict_format(client):
    r = client.post('/predict', json={'age': 30, 'revenu': 2500})
    assert r.status_code == 200

Related concepts

The whole glossary