Mercurial > hg
comparison tests/run-tests.py @ 21427:60f944758ad4
run-tests: give unittest wrapper a short description
This will make the output contain something useful rather than the
default repr() for the class.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 20 Apr 2014 11:24:37 -0700 |
parents | 791bdd65acd3 |
children | 3df2ecf8d545 |
comparison
equal
deleted
inserted
replaced
21426:791bdd65acd3 | 21427:60f944758ad4 |
---|---|
1249 t = testcls(self, test, count, refpath) | 1249 t = testcls(self, test, count, refpath) |
1250 | 1250 |
1251 if not asunit: | 1251 if not asunit: |
1252 return t | 1252 return t |
1253 | 1253 |
1254 # If we want a unittest compatible object, we wrap our Test. | |
1255 class MercurialTest(unittest.TestCase): | 1254 class MercurialTest(unittest.TestCase): |
1255 def __init__(self, name, *args, **kwargs): | |
1256 super(MercurialTest, self).__init__(*args, **kwargs) | |
1257 self.name = name | |
1258 | |
1259 def shortDescription(self): | |
1260 return self.name | |
1261 | |
1256 def runTest(self): | 1262 def runTest(self): |
1257 t.run() | 1263 t.run() |
1258 | 1264 |
1259 return MercurialTest() | 1265 return MercurialTest(test) |
1260 | 1266 |
1261 def _cleanup(self): | 1267 def _cleanup(self): |
1262 """Clean up state from this test invocation.""" | 1268 """Clean up state from this test invocation.""" |
1263 | 1269 |
1264 if self.options.keep_tmpdir: | 1270 if self.options.keep_tmpdir: |