summaryrefslogtreecommitdiff
path: root/dev-python/testrepository/files/testrepository-0.0.18-test-backport.patch
blob: 112b0299df54656a81303dae3321418e8f7f26c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
diff --git a/testrepository/tests/test_repository.py b/testrepository/tests/test_repository.py
index e2e5e05..4a8667b 100644
--- a/testrepository/tests/test_repository.py
+++ b/testrepository/tests/test_repository.py
@@ -28,6 +28,7 @@
 from testresources import TestResource
 from testtools import (
     clone_test_with_new_id,
+    content,
     PlaceHolder,
     )
 import testtools
@@ -103,19 +104,24 @@ class Case(ResourcedTestCase):
     def passing(self):
         pass
 
-    def failing(self):
-        self.fail("oops")
-
     def unexpected_success(self):
         self.expectFailure("unexpected success", self.assertTrue, True)
 
 
+class FailingCase:
+
+    def run(self, result):
+        result.startTest(self)
+        result.addError(
+            self, None, details={'traceback': content.text_content("")})
+        result.stopTest(self)
+
 def make_test(id, should_pass):
     """Make a test."""
     if should_pass:
         case = Case("passing")
     else:
-        case = Case("failing")
+        case = FailingCase()
     return clone_test_with_new_id(case, id)