I've lost the original thread, but `assert_warns` is explicitly for warnings produced by the warnings module, not for errors, for which `assert_raises` or `assert_raises_regexp` is appropriate.