Serhiy Storchaka added the comment: I would use test.support.swapattr(). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report at bugs.python.org> <http://bugs.python.org/issue24678> _______________________________________