diff -r c91e7f707562 Lib/test/regrtest.py --- a/Lib/test/regrtest.py Tue Jul 09 00:49:03 2013 +0200 +++ b/Lib/test/regrtest.py Tue Jul 09 01:58:14 2013 +0200 @@ -676,8 +676,8 @@ def main(tests=None, testdir=None, verbo while True: for test in tests: yield test - if bad: - return + #if bad: + # return tests = test_forever() test_count = '' test_count_width = 3 diff -r c91e7f707562 Lib/unittest/case.py --- a/Lib/unittest/case.py Tue Jul 09 00:49:03 2013 +0200 +++ b/Lib/unittest/case.py Tue Jul 09 01:58:14 2013 +0200 @@ -8,6 +8,7 @@ import re import warnings import collections import contextlib +import failmalloc from . import result from .util import (strclass, safe_repr, _count_diff_all_purpose, @@ -493,7 +494,11 @@ class TestCase(object): if outcome.success: outcome.expecting_failure = expecting_failure with outcome.testPartExecutor(self, isTest=True): - testMethod() + failmalloc.enable() + try: + testMethod() + finally: + failmalloc.disable() outcome.expecting_failure = False with outcome.testPartExecutor(self): self.tearDown()