Mercurial > public > mercurial-scm > hg-stable
diff tests/run-tests.py @ 24965:cecbe207cebd
run-tests: implement Test._testMethodName
This methods is needed internally by utilities like __repr__. I do not see any
harm in having it declared. Any actual attempt to use it to call a test would
crash, but at least random debug print in the test runner will no longer crash.
Another approach would have been to redefine the __repr__ function, but I think
it a good thing to have some respect for the base class API.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 07 May 2015 23:18:48 -0700 |
parents | 3fe1e07f1a32 |
children | 00790cc2b753 |
line wrap: on
line diff
--- a/tests/run-tests.py Thu May 07 16:43:58 2015 -0700 +++ b/tests/run-tests.py Thu May 07 23:18:48 2015 -0700 @@ -442,6 +442,11 @@ else: self._refout = [] + # needed to get base class __repr__ running + @property + def _testMethodName(self): + return self.name + def __str__(self): return self.name