38 @param test Reference to the test object |
38 @param test Reference to the test object |
39 @param err The error traceback |
39 @param err The error traceback |
40 """ |
40 """ |
41 TestResult.addFailure(self, test, err) |
41 TestResult.addFailure(self, test, err) |
42 tracebackLines = self._exc_info_to_string(err, test) |
42 tracebackLines = self._exc_info_to_string(err, test) |
43 self.parent.write('%s%s\n' % (ResponseUTTestFailed, |
43 self.parent.write( |
44 unicode((unicode(test), tracebackLines, test.id())))) |
44 '%s%s\n' % ( |
|
45 ResponseUTTestFailed, |
|
46 unicode((unicode(test), tracebackLines, test.id())))) |
45 |
47 |
46 def addError(self, test, err): |
48 def addError(self, test, err): |
47 """ |
49 """ |
48 Method called if a test errored. |
50 Method called if a test errored. |
49 |
51 |
50 @param test Reference to the test object |
52 @param test Reference to the test object |
51 @param err The error traceback |
53 @param err The error traceback |
52 """ |
54 """ |
53 TestResult.addError(self, test, err) |
55 TestResult.addError(self, test, err) |
54 tracebackLines = self._exc_info_to_string(err, test) |
56 tracebackLines = self._exc_info_to_string(err, test) |
55 self.parent.write('%s%s\n' % (ResponseUTTestErrored, |
57 self.parent.write( |
56 unicode((unicode(test), tracebackLines, test.id())))) |
58 '%s%s\n' % ( |
|
59 ResponseUTTestErrored, |
|
60 unicode((unicode(test), tracebackLines, test.id())))) |
57 |
61 |
58 def addSkip(self, test, reason): |
62 def addSkip(self, test, reason): |
59 """ |
63 """ |
60 Method called if a test was skipped. |
64 Method called if a test was skipped. |
61 |
65 |
62 @param test reference to the test object |
66 @param test reference to the test object |
63 @param reason reason for skipping the test (string) |
67 @param reason reason for skipping the test (string) |
64 """ |
68 """ |
65 TestResult.addSkip(self, test, reason) |
69 TestResult.addSkip(self, test, reason) |
66 self.parent.write('%s%s\n' % (ResponseUTTestSkipped, |
70 self.parent.write( |
67 str((str(test), reason, test.id())))) |
71 '%s%s\n' % ( |
|
72 ResponseUTTestSkipped, |
|
73 str((str(test), reason, test.id())))) |
68 |
74 |
69 def addExpectedFailure(self, test, err): |
75 def addExpectedFailure(self, test, err): |
70 """ |
76 """ |
71 Method called if a test failed expected. |
77 Method called if a test failed expected. |
72 |
78 |
73 @param test reference to the test object |
79 @param test reference to the test object |
74 @param err error traceback |
80 @param err error traceback |
75 """ |
81 """ |
76 TestResult.addExpectedFailure(self, test, err) |
82 TestResult.addExpectedFailure(self, test, err) |
77 tracebackLines = self._exc_info_to_string(err, test) |
83 tracebackLines = self._exc_info_to_string(err, test) |
78 self.parent.write('%s%s\n' % (ResponseUTTestFailedExpected, |
84 self.parent.write( |
79 str((str(test), tracebackLines, test.id())))) |
85 '%s%s\n' % ( |
|
86 ResponseUTTestFailedExpected, |
|
87 str((str(test), tracebackLines, test.id())))) |
80 |
88 |
81 def addUnexpectedSuccess(self, test): |
89 def addUnexpectedSuccess(self, test): |
82 """ |
90 """ |
83 Method called if a test succeeded expectedly. |
91 Method called if a test succeeded expectedly. |
84 |
92 |
85 @param test reference to the test object |
93 @param test reference to the test object |
86 """ |
94 """ |
87 TestResult.addUnexpectedSuccess(self, test) |
95 TestResult.addUnexpectedSuccess(self, test) |
88 self.parent.write('%s%s\n' % (ResponseUTTestSucceededUnexpected, |
96 self.parent.write( |
89 str((str(test), test.id())))) |
97 '%s%s\n' % ( |
|
98 ResponseUTTestSucceededUnexpected, |
|
99 str((str(test), test.id())))) |
90 |
100 |
91 def startTest(self, test): |
101 def startTest(self, test): |
92 """ |
102 """ |
93 Method called at the start of a test. |
103 Method called at the start of a test. |
94 |
104 |
95 @param test Reference to the test object |
105 @param test Reference to the test object |
96 """ |
106 """ |
97 TestResult.startTest(self, test) |
107 TestResult.startTest(self, test) |
98 self.parent.write('%s%s\n' % (ResponseUTStartTest, |
108 self.parent.write( |
99 unicode((unicode(test), test.shortDescription())))) |
109 '%s%s\n' % ( |
|
110 ResponseUTStartTest, |
|
111 unicode((unicode(test), test.shortDescription())))) |
100 |
112 |
101 def stopTest(self, test): |
113 def stopTest(self, test): |
102 """ |
114 """ |
103 Method called at the end of a test. |
115 Method called at the end of a test. |
104 |
116 |