@@ -176,6 +176,47 @@ If you want to include only tests that include both patterns, `and` is to be use
```bash
pytest -k "test and ada" tests/test_optimization.py
```
### Run documentation tests
In order to test whether the documentation examples are correct, you should checkt that the `doctests` are passing.
As an example, let's use [`WhisperModel.forward`'s docstring](https://github.com/huggingface/transformers/blob/main/src/transformers/models/whisper/modeling_whisper.py#L1017-L1035):
```python
r"""
Returns:
Example:
```python
>>> import torch
>>> from transformers import WhisperModel, WhisperFeatureExtractor
>>> from datasets import load_dataset
>>> model = WhisperModel.from_pretrained("openai/whisper-base")
3 steps are required to debug the docstring examples :
1. In order to properly run the test, **an extra line has to be added** at the end of the docstring. This can be automatically done on any file using :