TST: fix py3k issues with catching warnings on tests