So instead of:
```python
with warnings.catch_warnings(record=True) as w:
    warnings.simplefilter("always")
    X, y = make_classification(n_samples=20, n_features=10, random_state=0)
    clf = FailingClassifier()
    gs = GridSearchCV(clf, [{'parameter': [0, 1, 2]}], scoring='accuracy',
                      refit=False, on_error=0.0)
    gs.fit(X, y)
```

I would just have the following?

```python
X, y = make_classification(n_samples=20, n_features=10, random_state=0)
clf = FailingClassifier()
gs = GridSearchCV(clf, [{'parameter': [0, 1, 2]}], scoring='accuracy',
                  refit=False, on_error=0.0)
assert_warns(FitFailedWarning, gs.fit, X, y)
```