diff -r 7a62b5ee32ec Lib/unittest/case.py --- a/Lib/unittest/case.py Thu Jan 10 11:15:57 2013 -0500 +++ b/Lib/unittest/case.py Fri Jan 11 10:42:35 2013 +0200 @@ -411,6 +411,8 @@ outcome.errors.append(sys.exc_info()) def run(self, result=None): + _checkTestOverriding(self.__class__, self._testMethodName) + return orig_result = result if result is None: result = self.defaultTestResult() @@ -1213,3 +1215,17 @@ return self._description doc = self._testFunc.__doc__ return doc and doc.split("\n")[0].strip() or None + +def _checkTestOverriding(cls, methodName): + method = getattr(cls, methodName) + for c in cls.__mro__: + m = getattr(c, methodName, None) + if m is None: + continue + if m != method: +# warnings.warn('%s: %s method in %s hides the test in %s' % +# (cls.__module__, methodName, cls.__qualname__, c.__qualname__), +# RuntimeWarning, 2) + print('%s: %s method in %s hides the test in %s' % + (cls.__module__, methodName, cls.__qualname__, c.__qualname__), file=sys.stderr) + return