FIX warning check in test_affinities

Tentative PR to see if this fixes the travis failures on `test_affinities` such as this one:

https://travis-ci.org/scikit-learn/scikit-learn/jobs/37830488

I cannot reproduce it on my local Python 2.7 so it's a shot in the dark.