# testing.check_link

``` python
testing.check_link(link, likelihood, outputs)
```

Check a link approximation against the core contracts.

- It satisfies `LinkApprox`, and `supports` returns a bool.
- It is called with a `generator` keyword, as `Linearized` calls it.
- `supports` agrees with applying it: when False, the call raises `CapabilityError` or `StructureError`; when True, it raises neither.
- It returns a `Distribution`. A torch `Categorical` has finite, non-negative probabilities summing to 1 over the classes (up to `RTOL`); any other distribution has a finite mean and a finite, non-negative variance.

When `supports` returns True, errors other than `CapabilityError` and `StructureError` from applying the link propagate.

## Parameters

| Name | Type | Description | Default |
|----|----|----|----|
| link | LinkApprox | The link approximation. | *required* |
| likelihood | Likelihood | The likelihood to apply it with. | *required* |
| outputs | OutputGaussian | The Gaussian over the outputs. `supports` sees its mean. | *required* |

## Raises

| Name | Type | Description |
|----|----|----|
|  | AssertionError | A law above fails, including a call that raises another error after `supports` returned False. The message names the law and `link`. |
