|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.PyUnit.UnittestDialog</title> |
|
4 <meta charset="UTF-8"> |
|
5 <style> |
|
6 body { |
|
7 background: #EDECE6; |
|
8 margin: 0em 1em 10em 1em; |
|
9 color: black; |
|
10 } |
|
11 |
|
12 h1 { color: white; background: #85774A; } |
|
13 h2 { color: white; background: #85774A; } |
|
14 h3 { color: white; background: #9D936E; } |
|
15 h4 { color: white; background: #9D936E; } |
|
16 |
|
17 a { color: #BA6D36; } |
|
18 |
|
19 </style> |
|
20 </head> |
|
21 <body><a NAME="top" ID="top"></a> |
|
22 <h1>eric6.PyUnit.UnittestDialog</h1> |
|
23 <p> |
|
24 Module implementing the UI to the pyunit package. |
|
25 </p> |
|
26 <h3>Global Attributes</h3> |
|
27 <table> |
|
28 <tr><td>None</td></tr> |
|
29 </table> |
|
30 <h3>Classes</h3> |
|
31 <table> |
|
32 <tr> |
|
33 <td><a href="#QtTestResult">QtTestResult</a></td> |
|
34 <td>A TestResult derivative to work with a graphical GUI.</td> |
|
35 </tr><tr> |
|
36 <td><a href="#UnittestDialog">UnittestDialog</a></td> |
|
37 <td>Class implementing the UI to the pyunit package.</td> |
|
38 </tr><tr> |
|
39 <td><a href="#UnittestWindow">UnittestWindow</a></td> |
|
40 <td>Main window class for the standalone dialog.</td> |
|
41 </tr> |
|
42 </table> |
|
43 <h3>Functions</h3> |
|
44 <table> |
|
45 <tr><td>None</td></tr> |
|
46 </table> |
|
47 <hr /><hr /> |
|
48 <a NAME="QtTestResult" ID="QtTestResult"></a> |
|
49 <h2>QtTestResult</h2> |
|
50 <p> |
|
51 A TestResult derivative to work with a graphical GUI. |
|
52 </p><p> |
|
53 For more details see pyunit.py of the standard Python distribution. |
|
54 </p> |
|
55 <h3>Derived from</h3> |
|
56 unittest.TestResult |
|
57 <h3>Class Attributes</h3> |
|
58 <table> |
|
59 <tr><td>None</td></tr> |
|
60 </table> |
|
61 <h3>Class Methods</h3> |
|
62 <table> |
|
63 <tr><td>None</td></tr> |
|
64 </table> |
|
65 <h3>Methods</h3> |
|
66 <table> |
|
67 <tr> |
|
68 <td><a href="#QtTestResult.__init__">QtTestResult</a></td> |
|
69 <td>Constructor</td> |
|
70 </tr><tr> |
|
71 <td><a href="#QtTestResult.addError">addError</a></td> |
|
72 <td>Public method called if a test errored.</td> |
|
73 </tr><tr> |
|
74 <td><a href="#QtTestResult.addExpectedFailure">addExpectedFailure</a></td> |
|
75 <td>Public method called if a test failed expected.</td> |
|
76 </tr><tr> |
|
77 <td><a href="#QtTestResult.addFailure">addFailure</a></td> |
|
78 <td>Public method called if a test failed.</td> |
|
79 </tr><tr> |
|
80 <td><a href="#QtTestResult.addSkip">addSkip</a></td> |
|
81 <td>Public method called if a test was skipped.</td> |
|
82 </tr><tr> |
|
83 <td><a href="#QtTestResult.addUnexpectedSuccess">addUnexpectedSuccess</a></td> |
|
84 <td>Public method called if a test succeeded expectedly.</td> |
|
85 </tr><tr> |
|
86 <td><a href="#QtTestResult.startTest">startTest</a></td> |
|
87 <td>Public method called at the start of a test.</td> |
|
88 </tr><tr> |
|
89 <td><a href="#QtTestResult.stopTest">stopTest</a></td> |
|
90 <td>Public method called at the end of a test.</td> |
|
91 </tr> |
|
92 </table> |
|
93 <h3>Static Methods</h3> |
|
94 <table> |
|
95 <tr><td>None</td></tr> |
|
96 </table> |
|
97 <a NAME="QtTestResult.__init__" ID="QtTestResult.__init__"></a> |
|
98 <h4>QtTestResult (Constructor)</h4> |
|
99 <b>QtTestResult</b>(<i>parent, failfast</i>) |
|
100 <p> |
|
101 Constructor |
|
102 </p><dl> |
|
103 <dt><i>parent</i> (UnittestDialog)</dt> |
|
104 <dd> |
|
105 reference to the parent widget |
|
106 </dd><dt><i>failfast</i> (bool)</dt> |
|
107 <dd> |
|
108 flag indicating to stop at the first error |
|
109 </dd> |
|
110 </dl><a NAME="QtTestResult.addError" ID="QtTestResult.addError"></a> |
|
111 <h4>QtTestResult.addError</h4> |
|
112 <b>addError</b>(<i>test, err</i>) |
|
113 <p> |
|
114 Public method called if a test errored. |
|
115 </p><dl> |
|
116 <dt><i>test</i></dt> |
|
117 <dd> |
|
118 reference to the test object |
|
119 </dd><dt><i>err</i></dt> |
|
120 <dd> |
|
121 error traceback |
|
122 </dd> |
|
123 </dl><a NAME="QtTestResult.addExpectedFailure" ID="QtTestResult.addExpectedFailure"></a> |
|
124 <h4>QtTestResult.addExpectedFailure</h4> |
|
125 <b>addExpectedFailure</b>(<i>test, err</i>) |
|
126 <p> |
|
127 Public method called if a test failed expected. |
|
128 </p><dl> |
|
129 <dt><i>test</i></dt> |
|
130 <dd> |
|
131 reference to the test object |
|
132 </dd><dt><i>err</i></dt> |
|
133 <dd> |
|
134 error traceback |
|
135 </dd> |
|
136 </dl><a NAME="QtTestResult.addFailure" ID="QtTestResult.addFailure"></a> |
|
137 <h4>QtTestResult.addFailure</h4> |
|
138 <b>addFailure</b>(<i>test, err</i>) |
|
139 <p> |
|
140 Public method called if a test failed. |
|
141 </p><dl> |
|
142 <dt><i>test</i></dt> |
|
143 <dd> |
|
144 reference to the test object |
|
145 </dd><dt><i>err</i></dt> |
|
146 <dd> |
|
147 error traceback |
|
148 </dd> |
|
149 </dl><a NAME="QtTestResult.addSkip" ID="QtTestResult.addSkip"></a> |
|
150 <h4>QtTestResult.addSkip</h4> |
|
151 <b>addSkip</b>(<i>test, reason</i>) |
|
152 <p> |
|
153 Public method called if a test was skipped. |
|
154 </p><dl> |
|
155 <dt><i>test</i></dt> |
|
156 <dd> |
|
157 reference to the test object |
|
158 </dd><dt><i>reason</i></dt> |
|
159 <dd> |
|
160 reason for skipping the test (string) |
|
161 </dd> |
|
162 </dl><a NAME="QtTestResult.addUnexpectedSuccess" ID="QtTestResult.addUnexpectedSuccess"></a> |
|
163 <h4>QtTestResult.addUnexpectedSuccess</h4> |
|
164 <b>addUnexpectedSuccess</b>(<i>test</i>) |
|
165 <p> |
|
166 Public method called if a test succeeded expectedly. |
|
167 </p><dl> |
|
168 <dt><i>test</i></dt> |
|
169 <dd> |
|
170 reference to the test object |
|
171 </dd> |
|
172 </dl><a NAME="QtTestResult.startTest" ID="QtTestResult.startTest"></a> |
|
173 <h4>QtTestResult.startTest</h4> |
|
174 <b>startTest</b>(<i>test</i>) |
|
175 <p> |
|
176 Public method called at the start of a test. |
|
177 </p><dl> |
|
178 <dt><i>test</i></dt> |
|
179 <dd> |
|
180 Reference to the test object |
|
181 </dd> |
|
182 </dl><a NAME="QtTestResult.stopTest" ID="QtTestResult.stopTest"></a> |
|
183 <h4>QtTestResult.stopTest</h4> |
|
184 <b>stopTest</b>(<i>test</i>) |
|
185 <p> |
|
186 Public method called at the end of a test. |
|
187 </p><dl> |
|
188 <dt><i>test</i></dt> |
|
189 <dd> |
|
190 Reference to the test object |
|
191 </dd> |
|
192 </dl> |
|
193 <div align="right"><a href="#top">Up</a></div> |
|
194 <hr /><hr /> |
|
195 <a NAME="UnittestDialog" ID="UnittestDialog"></a> |
|
196 <h2>UnittestDialog</h2> |
|
197 <p> |
|
198 Class implementing the UI to the pyunit package. |
|
199 </p><h3>Signals</h3> |
|
200 <dl> |
|
201 <dt>unittestFile(str, int, bool)</dt> |
|
202 <dd> |
|
203 emitted to show the source of a |
|
204 unittest file |
|
205 </dd><dt>unittestStopped()</dt> |
|
206 <dd> |
|
207 emitted after a unit test was run |
|
208 </dd> |
|
209 </dl> |
|
210 <h3>Derived from</h3> |
|
211 QWidget, Ui_UnittestDialog |
|
212 <h3>Class Attributes</h3> |
|
213 <table> |
|
214 <tr><td>ErrorsInfoRole</td></tr><tr><td>TestCaseFileRole</td></tr><tr><td>TestCaseNameRole</td></tr> |
|
215 </table> |
|
216 <h3>Class Methods</h3> |
|
217 <table> |
|
218 <tr><td>None</td></tr> |
|
219 </table> |
|
220 <h3>Methods</h3> |
|
221 <table> |
|
222 <tr> |
|
223 <td><a href="#UnittestDialog.__init__">UnittestDialog</a></td> |
|
224 <td>Constructor</td> |
|
225 </tr><tr> |
|
226 <td><a href="#UnittestDialog.__UTDiscovered">__UTDiscovered</a></td> |
|
227 <td>Private slot to handle the utDiscovered signal.</td> |
|
228 </tr><tr> |
|
229 <td><a href="#UnittestDialog.__UTPrepared">__UTPrepared</a></td> |
|
230 <td>Private slot to handle the utPrepared signal.</td> |
|
231 </tr><tr> |
|
232 <td><a href="#UnittestDialog.__assembleTestCasesList">__assembleTestCasesList</a></td> |
|
233 <td>Private method to assemble a list of test cases included in a test suite.</td> |
|
234 </tr><tr> |
|
235 <td><a href="#UnittestDialog.__discover">__discover</a></td> |
|
236 <td>Private slot to discover unit test but don't run them.</td> |
|
237 </tr><tr> |
|
238 <td><a href="#UnittestDialog.__findDiscoveryItem">__findDiscoveryItem</a></td> |
|
239 <td>Private method to find an item given the module path.</td> |
|
240 </tr><tr> |
|
241 <td><a href="#UnittestDialog.__openEditor">__openEditor</a></td> |
|
242 <td>Private method to open an editor window for the given file.</td> |
|
243 </tr><tr> |
|
244 <td><a href="#UnittestDialog.__populateDiscoveryResults">__populateDiscoveryResults</a></td> |
|
245 <td>Private method to populate the test discovery results list.</td> |
|
246 </tr><tr> |
|
247 <td><a href="#UnittestDialog.__populateVenvComboBox">__populateVenvComboBox</a></td> |
|
248 <td>Private method to (re-)populate the virtual environments selector.</td> |
|
249 </tr><tr> |
|
250 <td><a href="#UnittestDialog.__selectedTestCases">__selectedTestCases</a></td> |
|
251 <td>Private method to assemble the list of selected test cases and suites.</td> |
|
252 </tr><tr> |
|
253 <td><a href="#UnittestDialog.__setProgressColor">__setProgressColor</a></td> |
|
254 <td>Private methode to set the color of the progress color label.</td> |
|
255 </tr><tr> |
|
256 <td><a href="#UnittestDialog.__setRunningMode">__setRunningMode</a></td> |
|
257 <td>Private method to set the GUI in running mode.</td> |
|
258 </tr><tr> |
|
259 <td><a href="#UnittestDialog.__setStoppedMode">__setStoppedMode</a></td> |
|
260 <td>Private method to set the GUI in stopped mode.</td> |
|
261 </tr><tr> |
|
262 <td><a href="#UnittestDialog.__showSource">__showSource</a></td> |
|
263 <td>Private slot to show the source of a traceback in an eric6 editor.</td> |
|
264 </tr><tr> |
|
265 <td><a href="#UnittestDialog.__stopTests">__stopTests</a></td> |
|
266 <td>Private slot to stop the test.</td> |
|
267 </tr><tr> |
|
268 <td><a href="#UnittestDialog.closeEvent">closeEvent</a></td> |
|
269 <td>Protected method to handle the close event.</td> |
|
270 </tr><tr> |
|
271 <td><a href="#UnittestDialog.hasFailedTests">hasFailedTests</a></td> |
|
272 <td>Public method to check, if there are failed tests from the last run.</td> |
|
273 </tr><tr> |
|
274 <td><a href="#UnittestDialog.insertDiscovery">insertDiscovery</a></td> |
|
275 <td>Public slot to insert the discovery start directory into the discoveryPicker object.</td> |
|
276 </tr><tr> |
|
277 <td><a href="#UnittestDialog.insertProg">insertProg</a></td> |
|
278 <td>Public slot to insert the filename prog into the testsuitePicker object.</td> |
|
279 </tr><tr> |
|
280 <td><a href="#UnittestDialog.insertTestName">insertTestName</a></td> |
|
281 <td>Public slot to insert a test name into the testComboBox object.</td> |
|
282 </tr><tr> |
|
283 <td><a href="#UnittestDialog.keyPressEvent">keyPressEvent</a></td> |
|
284 <td>Protected slot to handle key press events.</td> |
|
285 </tr><tr> |
|
286 <td><a href="#UnittestDialog.on_buttonBox_clicked">on_buttonBox_clicked</a></td> |
|
287 <td>Private slot called by a button of the button box clicked.</td> |
|
288 </tr><tr> |
|
289 <td><a href="#UnittestDialog.on_discoverCheckBox_toggled">on_discoverCheckBox_toggled</a></td> |
|
290 <td>Private slot handling state changes of the 'discover' checkbox.</td> |
|
291 </tr><tr> |
|
292 <td><a href="#UnittestDialog.on_discoveryList_itemDoubleClicked">on_discoveryList_itemDoubleClicked</a></td> |
|
293 <td>Private slot handling the user double clicking an item.</td> |
|
294 </tr><tr> |
|
295 <td><a href="#UnittestDialog.on_errorsListWidget_currentTextChanged">on_errorsListWidget_currentTextChanged</a></td> |
|
296 <td>Private slot to handle the highlighted signal.</td> |
|
297 </tr><tr> |
|
298 <td><a href="#UnittestDialog.on_errorsListWidget_itemDoubleClicked">on_errorsListWidget_itemDoubleClicked</a></td> |
|
299 <td>Private slot called by doubleclicking an errorlist entry.</td> |
|
300 </tr><tr> |
|
301 <td><a href="#UnittestDialog.on_testsuitePicker_aboutToShowPathPickerDialog">on_testsuitePicker_aboutToShowPathPickerDialog</a></td> |
|
302 <td>Private slot called before the test suite selection dialog is shown.</td> |
|
303 </tr><tr> |
|
304 <td><a href="#UnittestDialog.on_testsuitePicker_editTextChanged">on_testsuitePicker_editTextChanged</a></td> |
|
305 <td>Private slot handling changes of the test suite path.</td> |
|
306 </tr><tr> |
|
307 <td><a href="#UnittestDialog.on_testsuitePicker_pathSelected">on_testsuitePicker_pathSelected</a></td> |
|
308 <td>Private slot called after a test suite has been selected.</td> |
|
309 </tr><tr> |
|
310 <td><a href="#UnittestDialog.setProjectMode">setProjectMode</a></td> |
|
311 <td>Public method to set the project mode of the dialog.</td> |
|
312 </tr><tr> |
|
313 <td><a href="#UnittestDialog.startTests">startTests</a></td> |
|
314 <td>Public slot to start the test.</td> |
|
315 </tr><tr> |
|
316 <td><a href="#UnittestDialog.testErrored">testErrored</a></td> |
|
317 <td>Public method called if a test errors.</td> |
|
318 </tr><tr> |
|
319 <td><a href="#UnittestDialog.testFailed">testFailed</a></td> |
|
320 <td>Public method called if a test fails.</td> |
|
321 </tr><tr> |
|
322 <td><a href="#UnittestDialog.testFailedExpected">testFailedExpected</a></td> |
|
323 <td>Public method called if a test fails expectedly.</td> |
|
324 </tr><tr> |
|
325 <td><a href="#UnittestDialog.testFinished">testFinished</a></td> |
|
326 <td>Public method called if a test has finished.</td> |
|
327 </tr><tr> |
|
328 <td><a href="#UnittestDialog.testSkipped">testSkipped</a></td> |
|
329 <td>Public method called if a test was skipped.</td> |
|
330 </tr><tr> |
|
331 <td><a href="#UnittestDialog.testStarted">testStarted</a></td> |
|
332 <td>Public method called if a test is about to be run.</td> |
|
333 </tr><tr> |
|
334 <td><a href="#UnittestDialog.testSucceededUnexpected">testSucceededUnexpected</a></td> |
|
335 <td>Public method called if a test succeeds unexpectedly.</td> |
|
336 </tr> |
|
337 </table> |
|
338 <h3>Static Methods</h3> |
|
339 <table> |
|
340 <tr><td>None</td></tr> |
|
341 </table> |
|
342 <a NAME="UnittestDialog.__init__" ID="UnittestDialog.__init__"></a> |
|
343 <h4>UnittestDialog (Constructor)</h4> |
|
344 <b>UnittestDialog</b>(<i>prog=None, dbs=None, ui=None, parent=None, name=None</i>) |
|
345 <p> |
|
346 Constructor |
|
347 </p><dl> |
|
348 <dt><i>prog</i> (str)</dt> |
|
349 <dd> |
|
350 filename of the program to open |
|
351 </dd><dt><i>dbs</i> (DebugServer)</dt> |
|
352 <dd> |
|
353 reference to the debug server object. It is an indication |
|
354 whether we were called from within the eric6 IDE. |
|
355 </dd><dt><i>ui</i> (UserInterface)</dt> |
|
356 <dd> |
|
357 reference to the UI object |
|
358 </dd><dt><i>parent</i> (QWidget)</dt> |
|
359 <dd> |
|
360 parent widget of this dialog |
|
361 </dd><dt><i>name</i> (str)</dt> |
|
362 <dd> |
|
363 name of this dialog |
|
364 </dd> |
|
365 </dl><a NAME="UnittestDialog.__UTDiscovered" ID="UnittestDialog.__UTDiscovered"></a> |
|
366 <h4>UnittestDialog.__UTDiscovered</h4> |
|
367 <b>__UTDiscovered</b>(<i>testCases, exc_type, exc_value</i>) |
|
368 <p> |
|
369 Private slot to handle the utDiscovered signal. |
|
370 </p><p> |
|
371 If the unittest suite was loaded successfully, we ask the |
|
372 client to run the test suite. |
|
373 </p><dl> |
|
374 <dt><i>testCases</i> (str)</dt> |
|
375 <dd> |
|
376 list of detected test cases |
|
377 </dd><dt><i>exc_type</i> (str)</dt> |
|
378 <dd> |
|
379 exception type occured during discovery |
|
380 </dd><dt><i>exc_value</i> (str)</dt> |
|
381 <dd> |
|
382 value of exception occured during discovery |
|
383 </dd> |
|
384 </dl><a NAME="UnittestDialog.__UTPrepared" ID="UnittestDialog.__UTPrepared"></a> |
|
385 <h4>UnittestDialog.__UTPrepared</h4> |
|
386 <b>__UTPrepared</b>(<i>nrTests, exc_type, exc_value</i>) |
|
387 <p> |
|
388 Private slot to handle the utPrepared signal. |
|
389 </p><p> |
|
390 If the unittest suite was loaded successfully, we ask the |
|
391 client to run the test suite. |
|
392 </p><dl> |
|
393 <dt><i>nrTests</i></dt> |
|
394 <dd> |
|
395 number of tests contained in the test suite (integer) |
|
396 </dd><dt><i>exc_type</i></dt> |
|
397 <dd> |
|
398 type of exception occured during preparation (string) |
|
399 </dd><dt><i>exc_value</i></dt> |
|
400 <dd> |
|
401 value of exception occured during preparation (string) |
|
402 </dd> |
|
403 </dl><a NAME="UnittestDialog.__assembleTestCasesList" ID="UnittestDialog.__assembleTestCasesList"></a> |
|
404 <h4>UnittestDialog.__assembleTestCasesList</h4> |
|
405 <b>__assembleTestCasesList</b>(<i>suite, start</i>) |
|
406 <p> |
|
407 Private method to assemble a list of test cases included in a test |
|
408 suite. |
|
409 </p><dl> |
|
410 <dt><i>suite</i> (unittest.TestSuite)</dt> |
|
411 <dd> |
|
412 test suite to be inspected |
|
413 </dd><dt><i>start</i> (str)</dt> |
|
414 <dd> |
|
415 name of directory discovery was started at |
|
416 </dd> |
|
417 </dl><dl> |
|
418 <dt>Returns:</dt> |
|
419 <dd> |
|
420 list of tuples containing the test case ID, a short description |
|
421 and the path of the test file name |
|
422 </dd> |
|
423 </dl><dl> |
|
424 <dt>Return Type:</dt> |
|
425 <dd> |
|
426 list of tuples of (str, str, str) |
|
427 </dd> |
|
428 </dl><a NAME="UnittestDialog.__discover" ID="UnittestDialog.__discover"></a> |
|
429 <h4>UnittestDialog.__discover</h4> |
|
430 <b>__discover</b>(<i></i>) |
|
431 <p> |
|
432 Private slot to discover unit test but don't run them. |
|
433 </p><a NAME="UnittestDialog.__findDiscoveryItem" ID="UnittestDialog.__findDiscoveryItem"></a> |
|
434 <h4>UnittestDialog.__findDiscoveryItem</h4> |
|
435 <b>__findDiscoveryItem</b>(<i>modulePath</i>) |
|
436 <p> |
|
437 Private method to find an item given the module path. |
|
438 </p><dl> |
|
439 <dt><i>modulePath</i> (str)</dt> |
|
440 <dd> |
|
441 path of the module in dotted notation |
|
442 </dd> |
|
443 </dl><dl> |
|
444 <dt>Returns:</dt> |
|
445 <dd> |
|
446 reference to the item or None |
|
447 </dd> |
|
448 </dl><dl> |
|
449 <dt>Return Type:</dt> |
|
450 <dd> |
|
451 QTreeWidgetItem or None |
|
452 </dd> |
|
453 </dl><a NAME="UnittestDialog.__openEditor" ID="UnittestDialog.__openEditor"></a> |
|
454 <h4>UnittestDialog.__openEditor</h4> |
|
455 <b>__openEditor</b>(<i>filename, linenumber</i>) |
|
456 <p> |
|
457 Private method to open an editor window for the given file. |
|
458 </p><p> |
|
459 Note: This method opens an editor window when the unittest dialog |
|
460 is called as a standalone application. |
|
461 </p><dl> |
|
462 <dt><i>filename</i> (str)</dt> |
|
463 <dd> |
|
464 path of the file to be opened |
|
465 </dd><dt><i>linenumber</i> (int)</dt> |
|
466 <dd> |
|
467 line number to place the cursor at |
|
468 </dd> |
|
469 </dl><a NAME="UnittestDialog.__populateDiscoveryResults" ID="UnittestDialog.__populateDiscoveryResults"></a> |
|
470 <h4>UnittestDialog.__populateDiscoveryResults</h4> |
|
471 <b>__populateDiscoveryResults</b>(<i>tests</i>) |
|
472 <p> |
|
473 Private method to populate the test discovery results list. |
|
474 </p><dl> |
|
475 <dt><i>tests</i> (list of tuples of (str, str, str))</dt> |
|
476 <dd> |
|
477 list of tuples containing the discovery results |
|
478 </dd> |
|
479 </dl><a NAME="UnittestDialog.__populateVenvComboBox" ID="UnittestDialog.__populateVenvComboBox"></a> |
|
480 <h4>UnittestDialog.__populateVenvComboBox</h4> |
|
481 <b>__populateVenvComboBox</b>(<i></i>) |
|
482 <p> |
|
483 Private method to (re-)populate the virtual environments selector. |
|
484 </p><a NAME="UnittestDialog.__selectedTestCases" ID="UnittestDialog.__selectedTestCases"></a> |
|
485 <h4>UnittestDialog.__selectedTestCases</h4> |
|
486 <b>__selectedTestCases</b>(<i>parent=None</i>) |
|
487 <p> |
|
488 Private method to assemble the list of selected test cases and suites. |
|
489 </p><dl> |
|
490 <dt><i>parent</i> (QTreeWidgetItem)</dt> |
|
491 <dd> |
|
492 reference to the parent item |
|
493 </dd> |
|
494 </dl><dl> |
|
495 <dt>Returns:</dt> |
|
496 <dd> |
|
497 list of selected test cases |
|
498 </dd> |
|
499 </dl><dl> |
|
500 <dt>Return Type:</dt> |
|
501 <dd> |
|
502 list of str |
|
503 </dd> |
|
504 </dl><a NAME="UnittestDialog.__setProgressColor" ID="UnittestDialog.__setProgressColor"></a> |
|
505 <h4>UnittestDialog.__setProgressColor</h4> |
|
506 <b>__setProgressColor</b>(<i>color</i>) |
|
507 <p> |
|
508 Private methode to set the color of the progress color label. |
|
509 </p><dl> |
|
510 <dt><i>color</i></dt> |
|
511 <dd> |
|
512 colour to be shown (string) |
|
513 </dd> |
|
514 </dl><a NAME="UnittestDialog.__setRunningMode" ID="UnittestDialog.__setRunningMode"></a> |
|
515 <h4>UnittestDialog.__setRunningMode</h4> |
|
516 <b>__setRunningMode</b>(<i></i>) |
|
517 <p> |
|
518 Private method to set the GUI in running mode. |
|
519 </p><a NAME="UnittestDialog.__setStoppedMode" ID="UnittestDialog.__setStoppedMode"></a> |
|
520 <h4>UnittestDialog.__setStoppedMode</h4> |
|
521 <b>__setStoppedMode</b>(<i></i>) |
|
522 <p> |
|
523 Private method to set the GUI in stopped mode. |
|
524 </p><a NAME="UnittestDialog.__showSource" ID="UnittestDialog.__showSource"></a> |
|
525 <h4>UnittestDialog.__showSource</h4> |
|
526 <b>__showSource</b>(<i></i>) |
|
527 <p> |
|
528 Private slot to show the source of a traceback in an eric6 editor. |
|
529 </p><a NAME="UnittestDialog.__stopTests" ID="UnittestDialog.__stopTests"></a> |
|
530 <h4>UnittestDialog.__stopTests</h4> |
|
531 <b>__stopTests</b>(<i></i>) |
|
532 <p> |
|
533 Private slot to stop the test. |
|
534 </p><a NAME="UnittestDialog.closeEvent" ID="UnittestDialog.closeEvent"></a> |
|
535 <h4>UnittestDialog.closeEvent</h4> |
|
536 <b>closeEvent</b>(<i>event</i>) |
|
537 <p> |
|
538 Protected method to handle the close event. |
|
539 </p><dl> |
|
540 <dt><i>event</i> (QCloseEvent)</dt> |
|
541 <dd> |
|
542 close event |
|
543 </dd> |
|
544 </dl><a NAME="UnittestDialog.hasFailedTests" ID="UnittestDialog.hasFailedTests"></a> |
|
545 <h4>UnittestDialog.hasFailedTests</h4> |
|
546 <b>hasFailedTests</b>(<i></i>) |
|
547 <p> |
|
548 Public method to check, if there are failed tests from the last run. |
|
549 </p><dl> |
|
550 <dt>Returns:</dt> |
|
551 <dd> |
|
552 flag indicating the presence of failed tests (boolean) |
|
553 </dd> |
|
554 </dl><a NAME="UnittestDialog.insertDiscovery" ID="UnittestDialog.insertDiscovery"></a> |
|
555 <h4>UnittestDialog.insertDiscovery</h4> |
|
556 <b>insertDiscovery</b>(<i>start</i>) |
|
557 <p> |
|
558 Public slot to insert the discovery start directory into the |
|
559 discoveryPicker object. |
|
560 </p><dl> |
|
561 <dt><i>start</i> (str)</dt> |
|
562 <dd> |
|
563 start directory name to be inserted |
|
564 </dd> |
|
565 </dl><a NAME="UnittestDialog.insertProg" ID="UnittestDialog.insertProg"></a> |
|
566 <h4>UnittestDialog.insertProg</h4> |
|
567 <b>insertProg</b>(<i>prog</i>) |
|
568 <p> |
|
569 Public slot to insert the filename prog into the testsuitePicker |
|
570 object. |
|
571 </p><dl> |
|
572 <dt><i>prog</i></dt> |
|
573 <dd> |
|
574 filename to be inserted (string) |
|
575 </dd> |
|
576 </dl><a NAME="UnittestDialog.insertTestName" ID="UnittestDialog.insertTestName"></a> |
|
577 <h4>UnittestDialog.insertTestName</h4> |
|
578 <b>insertTestName</b>(<i>testName</i>) |
|
579 <p> |
|
580 Public slot to insert a test name into the testComboBox object. |
|
581 </p><dl> |
|
582 <dt><i>testName</i></dt> |
|
583 <dd> |
|
584 name of the test to be inserted (string) |
|
585 </dd> |
|
586 </dl><a NAME="UnittestDialog.keyPressEvent" ID="UnittestDialog.keyPressEvent"></a> |
|
587 <h4>UnittestDialog.keyPressEvent</h4> |
|
588 <b>keyPressEvent</b>(<i>evt</i>) |
|
589 <p> |
|
590 Protected slot to handle key press events. |
|
591 </p><dl> |
|
592 <dt><i>evt</i></dt> |
|
593 <dd> |
|
594 key press event to handle (QKeyEvent) |
|
595 </dd> |
|
596 </dl><a NAME="UnittestDialog.on_buttonBox_clicked" ID="UnittestDialog.on_buttonBox_clicked"></a> |
|
597 <h4>UnittestDialog.on_buttonBox_clicked</h4> |
|
598 <b>on_buttonBox_clicked</b>(<i>button</i>) |
|
599 <p> |
|
600 Private slot called by a button of the button box clicked. |
|
601 </p><dl> |
|
602 <dt><i>button</i></dt> |
|
603 <dd> |
|
604 button that was clicked (QAbstractButton) |
|
605 </dd> |
|
606 </dl><a NAME="UnittestDialog.on_discoverCheckBox_toggled" ID="UnittestDialog.on_discoverCheckBox_toggled"></a> |
|
607 <h4>UnittestDialog.on_discoverCheckBox_toggled</h4> |
|
608 <b>on_discoverCheckBox_toggled</b>(<i>checked</i>) |
|
609 <p> |
|
610 Private slot handling state changes of the 'discover' checkbox. |
|
611 </p><dl> |
|
612 <dt><i>checked</i> (bool)</dt> |
|
613 <dd> |
|
614 state of the checkbox |
|
615 </dd> |
|
616 </dl><a NAME="UnittestDialog.on_discoveryList_itemDoubleClicked" ID="UnittestDialog.on_discoveryList_itemDoubleClicked"></a> |
|
617 <h4>UnittestDialog.on_discoveryList_itemDoubleClicked</h4> |
|
618 <b>on_discoveryList_itemDoubleClicked</b>(<i>item, column</i>) |
|
619 <p> |
|
620 Private slot handling the user double clicking an item. |
|
621 </p><dl> |
|
622 <dt><i>item</i> (QTreeWidgetItem)</dt> |
|
623 <dd> |
|
624 reference to the item |
|
625 </dd><dt><i>column</i> (int)</dt> |
|
626 <dd> |
|
627 column of the double click |
|
628 </dd> |
|
629 </dl><a NAME="UnittestDialog.on_errorsListWidget_currentTextChanged" ID="UnittestDialog.on_errorsListWidget_currentTextChanged"></a> |
|
630 <h4>UnittestDialog.on_errorsListWidget_currentTextChanged</h4> |
|
631 <b>on_errorsListWidget_currentTextChanged</b>(<i>text</i>) |
|
632 <p> |
|
633 Private slot to handle the highlighted signal. |
|
634 </p><dl> |
|
635 <dt><i>text</i></dt> |
|
636 <dd> |
|
637 current text (string) |
|
638 </dd> |
|
639 </dl><a NAME="UnittestDialog.on_errorsListWidget_itemDoubleClicked" ID="UnittestDialog.on_errorsListWidget_itemDoubleClicked"></a> |
|
640 <h4>UnittestDialog.on_errorsListWidget_itemDoubleClicked</h4> |
|
641 <b>on_errorsListWidget_itemDoubleClicked</b>(<i>lbitem</i>) |
|
642 <p> |
|
643 Private slot called by doubleclicking an errorlist entry. |
|
644 </p><p> |
|
645 It will popup a dialog showing the stacktrace. |
|
646 If called from eric, an additional button is displayed |
|
647 to show the python source in an eric source viewer (in |
|
648 erics main window. |
|
649 </p><dl> |
|
650 <dt><i>lbitem</i></dt> |
|
651 <dd> |
|
652 the listbox item that was double clicked |
|
653 </dd> |
|
654 </dl><a NAME="UnittestDialog.on_testsuitePicker_aboutToShowPathPickerDialog" ID="UnittestDialog.on_testsuitePicker_aboutToShowPathPickerDialog"></a> |
|
655 <h4>UnittestDialog.on_testsuitePicker_aboutToShowPathPickerDialog</h4> |
|
656 <b>on_testsuitePicker_aboutToShowPathPickerDialog</b>(<i></i>) |
|
657 <p> |
|
658 Private slot called before the test suite selection dialog is shown. |
|
659 </p><a NAME="UnittestDialog.on_testsuitePicker_editTextChanged" ID="UnittestDialog.on_testsuitePicker_editTextChanged"></a> |
|
660 <h4>UnittestDialog.on_testsuitePicker_editTextChanged</h4> |
|
661 <b>on_testsuitePicker_editTextChanged</b>(<i>path</i>) |
|
662 <p> |
|
663 Private slot handling changes of the test suite path. |
|
664 </p><dl> |
|
665 <dt><i>path</i> (str)</dt> |
|
666 <dd> |
|
667 path of the test suite file |
|
668 </dd> |
|
669 </dl><a NAME="UnittestDialog.on_testsuitePicker_pathSelected" ID="UnittestDialog.on_testsuitePicker_pathSelected"></a> |
|
670 <h4>UnittestDialog.on_testsuitePicker_pathSelected</h4> |
|
671 <b>on_testsuitePicker_pathSelected</b>(<i>suite</i>) |
|
672 <p> |
|
673 Private slot called after a test suite has been selected. |
|
674 </p><dl> |
|
675 <dt><i>suite</i> (str)</dt> |
|
676 <dd> |
|
677 file name of the test suite |
|
678 </dd> |
|
679 </dl><a NAME="UnittestDialog.setProjectMode" ID="UnittestDialog.setProjectMode"></a> |
|
680 <h4>UnittestDialog.setProjectMode</h4> |
|
681 <b>setProjectMode</b>(<i>forProject</i>) |
|
682 <p> |
|
683 Public method to set the project mode of the dialog. |
|
684 </p><dl> |
|
685 <dt><i>forProject</i> (bool)</dt> |
|
686 <dd> |
|
687 flag indicating to run for the open project |
|
688 </dd> |
|
689 </dl><a NAME="UnittestDialog.startTests" ID="UnittestDialog.startTests"></a> |
|
690 <h4>UnittestDialog.startTests</h4> |
|
691 <b>startTests</b>(<i>failedOnly=False</i>) |
|
692 <p> |
|
693 Public slot to start the test. |
|
694 </p><dl> |
|
695 <dt><i>failedOnly=</i></dt> |
|
696 <dd> |
|
697 flag indicating to run only failed tests (boolean) |
|
698 </dd> |
|
699 </dl><a NAME="UnittestDialog.testErrored" ID="UnittestDialog.testErrored"></a> |
|
700 <h4>UnittestDialog.testErrored</h4> |
|
701 <b>testErrored</b>(<i>test, exc, testId</i>) |
|
702 <p> |
|
703 Public method called if a test errors. |
|
704 </p><dl> |
|
705 <dt><i>test</i></dt> |
|
706 <dd> |
|
707 name of the test (string) |
|
708 </dd><dt><i>exc</i></dt> |
|
709 <dd> |
|
710 string representation of the exception (string) |
|
711 </dd><dt><i>testId</i></dt> |
|
712 <dd> |
|
713 id of the test (string) |
|
714 </dd> |
|
715 </dl><a NAME="UnittestDialog.testFailed" ID="UnittestDialog.testFailed"></a> |
|
716 <h4>UnittestDialog.testFailed</h4> |
|
717 <b>testFailed</b>(<i>test, exc, testId</i>) |
|
718 <p> |
|
719 Public method called if a test fails. |
|
720 </p><dl> |
|
721 <dt><i>test</i></dt> |
|
722 <dd> |
|
723 name of the test (string) |
|
724 </dd><dt><i>exc</i></dt> |
|
725 <dd> |
|
726 string representation of the exception (string) |
|
727 </dd><dt><i>testId</i></dt> |
|
728 <dd> |
|
729 id of the test (string) |
|
730 </dd> |
|
731 </dl><a NAME="UnittestDialog.testFailedExpected" ID="UnittestDialog.testFailedExpected"></a> |
|
732 <h4>UnittestDialog.testFailedExpected</h4> |
|
733 <b>testFailedExpected</b>(<i>test, exc, testId</i>) |
|
734 <p> |
|
735 Public method called if a test fails expectedly. |
|
736 </p><dl> |
|
737 <dt><i>test</i></dt> |
|
738 <dd> |
|
739 name of the test (string) |
|
740 </dd><dt><i>exc</i></dt> |
|
741 <dd> |
|
742 string representation of the exception (string) |
|
743 </dd><dt><i>testId</i></dt> |
|
744 <dd> |
|
745 id of the test (string) |
|
746 </dd> |
|
747 </dl><a NAME="UnittestDialog.testFinished" ID="UnittestDialog.testFinished"></a> |
|
748 <h4>UnittestDialog.testFinished</h4> |
|
749 <b>testFinished</b>(<i></i>) |
|
750 <p> |
|
751 Public method called if a test has finished. |
|
752 </p><p> |
|
753 <b>Note</b>: It is also called if it has already failed or errored. |
|
754 </p><a NAME="UnittestDialog.testSkipped" ID="UnittestDialog.testSkipped"></a> |
|
755 <h4>UnittestDialog.testSkipped</h4> |
|
756 <b>testSkipped</b>(<i>test, reason, testId</i>) |
|
757 <p> |
|
758 Public method called if a test was skipped. |
|
759 </p><dl> |
|
760 <dt><i>test</i></dt> |
|
761 <dd> |
|
762 name of the test (string) |
|
763 </dd><dt><i>reason</i></dt> |
|
764 <dd> |
|
765 reason for skipping the test (string) |
|
766 </dd><dt><i>testId</i></dt> |
|
767 <dd> |
|
768 id of the test (string) |
|
769 </dd> |
|
770 </dl><a NAME="UnittestDialog.testStarted" ID="UnittestDialog.testStarted"></a> |
|
771 <h4>UnittestDialog.testStarted</h4> |
|
772 <b>testStarted</b>(<i>test, doc</i>) |
|
773 <p> |
|
774 Public method called if a test is about to be run. |
|
775 </p><dl> |
|
776 <dt><i>test</i></dt> |
|
777 <dd> |
|
778 name of the started test (string) |
|
779 </dd><dt><i>doc</i></dt> |
|
780 <dd> |
|
781 documentation of the started test (string) |
|
782 </dd> |
|
783 </dl><a NAME="UnittestDialog.testSucceededUnexpected" ID="UnittestDialog.testSucceededUnexpected"></a> |
|
784 <h4>UnittestDialog.testSucceededUnexpected</h4> |
|
785 <b>testSucceededUnexpected</b>(<i>test, testId</i>) |
|
786 <p> |
|
787 Public method called if a test succeeds unexpectedly. |
|
788 </p><dl> |
|
789 <dt><i>test</i></dt> |
|
790 <dd> |
|
791 name of the test (string) |
|
792 </dd><dt><i>testId</i></dt> |
|
793 <dd> |
|
794 id of the test (string) |
|
795 </dd> |
|
796 </dl> |
|
797 <div align="right"><a href="#top">Up</a></div> |
|
798 <hr /><hr /> |
|
799 <a NAME="UnittestWindow" ID="UnittestWindow"></a> |
|
800 <h2>UnittestWindow</h2> |
|
801 <p> |
|
802 Main window class for the standalone dialog. |
|
803 </p> |
|
804 <h3>Derived from</h3> |
|
805 E5MainWindow |
|
806 <h3>Class Attributes</h3> |
|
807 <table> |
|
808 <tr><td>None</td></tr> |
|
809 </table> |
|
810 <h3>Class Methods</h3> |
|
811 <table> |
|
812 <tr><td>None</td></tr> |
|
813 </table> |
|
814 <h3>Methods</h3> |
|
815 <table> |
|
816 <tr> |
|
817 <td><a href="#UnittestWindow.__init__">UnittestWindow</a></td> |
|
818 <td>Constructor</td> |
|
819 </tr><tr> |
|
820 <td><a href="#UnittestWindow.eventFilter">eventFilter</a></td> |
|
821 <td>Public method to filter events.</td> |
|
822 </tr> |
|
823 </table> |
|
824 <h3>Static Methods</h3> |
|
825 <table> |
|
826 <tr><td>None</td></tr> |
|
827 </table> |
|
828 <a NAME="UnittestWindow.__init__" ID="UnittestWindow.__init__"></a> |
|
829 <h4>UnittestWindow (Constructor)</h4> |
|
830 <b>UnittestWindow</b>(<i>prog=None, parent=None</i>) |
|
831 <p> |
|
832 Constructor |
|
833 </p><dl> |
|
834 <dt><i>prog</i></dt> |
|
835 <dd> |
|
836 filename of the program to open |
|
837 </dd><dt><i>parent</i></dt> |
|
838 <dd> |
|
839 reference to the parent widget (QWidget) |
|
840 </dd> |
|
841 </dl><a NAME="UnittestWindow.eventFilter" ID="UnittestWindow.eventFilter"></a> |
|
842 <h4>UnittestWindow.eventFilter</h4> |
|
843 <b>eventFilter</b>(<i>obj, event</i>) |
|
844 <p> |
|
845 Public method to filter events. |
|
846 </p><dl> |
|
847 <dt><i>obj</i></dt> |
|
848 <dd> |
|
849 reference to the object the event is meant for (QObject) |
|
850 </dd><dt><i>event</i></dt> |
|
851 <dd> |
|
852 reference to the event object (QEvent) |
|
853 </dd> |
|
854 </dl><dl> |
|
855 <dt>Returns:</dt> |
|
856 <dd> |
|
857 flag indicating, whether the event was handled (boolean) |
|
858 </dd> |
|
859 </dl> |
|
860 <div align="right"><a href="#top">Up</a></div> |
|
861 <hr /> |
|
862 </body></html> |