Berker Peksag added the comment: Another alternative is using assertWarnsRegex. ---------- nosy: +berker.peksag _______________________________________ Python tracker <report at bugs.python.org> <http://bugs.python.org/issue24237> _______________________________________