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