MAINT: copypaste assert_warns from a newer numpy into scipy