Backport of Python 2.7 unittest.TestCase methods