The first line of a docstring should be a short summary. So you could change this to:
```
    """Test grid search with on_error != 'raise'

    Ensures that a warning is raised and score reset where appropriate.
    """
```