ensure python 2.6 compatibility by backporting bits borrowed from standard unittest module