Isn't assert_warns only for exceptions, whereas this catches warnings emmited via warnings.warn(...) (which afaik doesn't raise anything)?