DebugClients/Python3/DCTestResult.py

changeset 3591
2f2a4a76dd22
parent 3160
209a07d7e401
child 3670
f0cb7579c0b4
equal deleted inserted replaced
3590:5280e37405b8 3591:2f2a4a76dd22
31 TestResult.__init__(self) 31 TestResult.__init__(self)
32 self.parent = parent 32 self.parent = parent
33 33
34 def addFailure(self, test, err): 34 def addFailure(self, test, err):
35 """ 35 """
36 Method called if a test failed. 36 Public method called if a test failed.
37 37
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)
44 ResponseUTTestFailed, 44 ResponseUTTestFailed,
45 str((str(test), tracebackLines, test.id())))) 45 str((str(test), tracebackLines, test.id()))))
46 46
47 def addError(self, test, err): 47 def addError(self, test, err):
48 """ 48 """
49 Method called if a test errored. 49 Public method called if a test errored.
50 50
51 @param test Reference to the test object 51 @param test Reference to the test object
52 @param err The error traceback 52 @param err The error traceback
53 """ 53 """
54 TestResult.addError(self, test, err) 54 TestResult.addError(self, test, err)
57 ResponseUTTestErrored, 57 ResponseUTTestErrored,
58 str((str(test), tracebackLines, test.id())))) 58 str((str(test), tracebackLines, test.id()))))
59 59
60 def addSkip(self, test, reason): 60 def addSkip(self, test, reason):
61 """ 61 """
62 Method called if a test was skipped. 62 Public method called if a test was skipped.
63 63
64 @param test reference to the test object 64 @param test reference to the test object
65 @param reason reason for skipping the test (string) 65 @param reason reason for skipping the test (string)
66 """ 66 """
67 TestResult.addSkip(self, test, reason) 67 TestResult.addSkip(self, test, reason)
69 ResponseUTTestSkipped, 69 ResponseUTTestSkipped,
70 str((str(test), reason, test.id())))) 70 str((str(test), reason, test.id()))))
71 71
72 def addExpectedFailure(self, test, err): 72 def addExpectedFailure(self, test, err):
73 """ 73 """
74 Method called if a test failed expected. 74 Public method called if a test failed expected.
75 75
76 @param test reference to the test object 76 @param test reference to the test object
77 @param err error traceback 77 @param err error traceback
78 """ 78 """
79 TestResult.addExpectedFailure(self, test, err) 79 TestResult.addExpectedFailure(self, test, err)
82 ResponseUTTestFailedExpected, 82 ResponseUTTestFailedExpected,
83 str((str(test), tracebackLines, test.id())))) 83 str((str(test), tracebackLines, test.id()))))
84 84
85 def addUnexpectedSuccess(self, test): 85 def addUnexpectedSuccess(self, test):
86 """ 86 """
87 Method called if a test succeeded expectedly. 87 Public method called if a test succeeded expectedly.
88 88
89 @param test reference to the test object 89 @param test reference to the test object
90 """ 90 """
91 TestResult.addUnexpectedSuccess(self, test) 91 TestResult.addUnexpectedSuccess(self, test)
92 self.parent.write('{0}{1}\n'.format( 92 self.parent.write('{0}{1}\n'.format(
93 ResponseUTTestSucceededUnexpected, 93 ResponseUTTestSucceededUnexpected,
94 str((str(test), test.id())))) 94 str((str(test), test.id()))))
95 95
96 def startTest(self, test): 96 def startTest(self, test):
97 """ 97 """
98 Method called at the start of a test. 98 Public method called at the start of a test.
99 99
100 @param test Reference to the test object 100 @param test Reference to the test object
101 """ 101 """
102 TestResult.startTest(self, test) 102 TestResult.startTest(self, test)
103 self.parent.write('{0}{1}\n'.format( 103 self.parent.write('{0}{1}\n'.format(
104 ResponseUTStartTest, 104 ResponseUTStartTest,
105 str((str(test), test.shortDescription())))) 105 str((str(test), test.shortDescription()))))
106 106
107 def stopTest(self, test): 107 def stopTest(self, test):
108 """ 108 """
109 Method called at the end of a test. 109 Public method called at the end of a test.
110 110
111 @param test Reference to the test object 111 @param test Reference to the test object
112 """ 112 """
113 TestResult.stopTest(self, test) 113 TestResult.stopTest(self, test)
114 self.parent.write('{0}\n'.format(ResponseUTStopTest)) 114 self.parent.write('{0}\n'.format(ResponseUTStopTest))

eric ide

mercurial