run-tests: give unittest wrapper a short description
authorGregory Szorc <gregory.szorc@gmail.com>
Sun, 20 Apr 2014 11:24:37 -0700
changeset 21427 60f944758ad4
parent 21426 791bdd65acd3
child 21428 3df2ecf8d545
run-tests: give unittest wrapper a short description This will make the output contain something useful rather than the default repr() for the class.
tests/run-tests.py
--- a/tests/run-tests.py	Sun Apr 20 11:22:08 2014 -0700
+++ b/tests/run-tests.py	Sun Apr 20 11:24:37 2014 -0700
@@ -1251,12 +1251,18 @@
         if not asunit:
             return t
 
-        # If we want a unittest compatible object, we wrap our Test.
         class MercurialTest(unittest.TestCase):
+            def __init__(self, name, *args, **kwargs):
+                super(MercurialTest, self).__init__(*args, **kwargs)
+                self.name = name
+
+            def shortDescription(self):
+                return self.name
+
             def runTest(self):
                 t.run()
 
-        return MercurialTest()
+        return MercurialTest(test)
 
     def _cleanup(self):
         """Clean up state from this test invocation."""