eric7/Documentation/Source/eric7.PyUnit.UnittestDialog.html

branch
eric7-maintenance
changeset 9131
bc0c1b6d6adb
parent 9112
9967ae9f0906
child 9136
9e0cf68f727b
equal deleted inserted replaced
9112:9967ae9f0906 9131:bc0c1b6d6adb
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric7.PyUnit.UnittestDialog</title>
4 <meta charset="UTF-8">
5 <link rel="stylesheet" href="styles.css">
6 </head>
7 <body>
8 <a NAME="top" ID="top"></a>
9 <h1>eric7.PyUnit.UnittestDialog</h1>
10
11 <p>
12 Module implementing the UI to the pyunit package.
13 </p>
14 <h3>Global Attributes</h3>
15
16 <table>
17 <tr><td>None</td></tr>
18 </table>
19 <h3>Classes</h3>
20
21 <table>
22
23 <tr>
24 <td><a href="#QtTestResult">QtTestResult</a></td>
25 <td>A TestResult derivative to work with a graphical GUI.</td>
26 </tr>
27 <tr>
28 <td><a href="#UnittestDialog">UnittestDialog</a></td>
29 <td>Class implementing the UI to the pyunit package.</td>
30 </tr>
31 <tr>
32 <td><a href="#UnittestWindow">UnittestWindow</a></td>
33 <td>Main window class for the standalone dialog.</td>
34 </tr>
35 </table>
36 <h3>Functions</h3>
37
38 <table>
39
40 <tr>
41 <td><a href="#clearSavedHistories">clearSavedHistories</a></td>
42 <td>Function to clear the saved history lists.</td>
43 </tr>
44 </table>
45 <hr />
46 <hr />
47 <a NAME="QtTestResult" ID="QtTestResult"></a>
48 <h2>QtTestResult</h2>
49
50 <p>
51 A TestResult derivative to work with a graphical GUI.
52 </p>
53 <p>
54 For more details see pyunit.py of the standard Python distribution.
55 </p>
56 <h3>Derived from</h3>
57 unittest.TestResult
58 <h3>Class Attributes</h3>
59
60 <table>
61 <tr><td>None</td></tr>
62 </table>
63 <h3>Class Methods</h3>
64
65 <table>
66 <tr><td>None</td></tr>
67 </table>
68 <h3>Methods</h3>
69
70 <table>
71
72 <tr>
73 <td><a href="#QtTestResult.__init__">QtTestResult</a></td>
74 <td>Constructor</td>
75 </tr>
76 <tr>
77 <td><a href="#QtTestResult.addError">addError</a></td>
78 <td>Public method called if a test errored.</td>
79 </tr>
80 <tr>
81 <td><a href="#QtTestResult.addExpectedFailure">addExpectedFailure</a></td>
82 <td>Public method called if a test failed expected.</td>
83 </tr>
84 <tr>
85 <td><a href="#QtTestResult.addFailure">addFailure</a></td>
86 <td>Public method called if a test failed.</td>
87 </tr>
88 <tr>
89 <td><a href="#QtTestResult.addSkip">addSkip</a></td>
90 <td>Public method called if a test was skipped.</td>
91 </tr>
92 <tr>
93 <td><a href="#QtTestResult.addSubTest">addSubTest</a></td>
94 <td>Public method called for each subtest to record its result.</td>
95 </tr>
96 <tr>
97 <td><a href="#QtTestResult.addUnexpectedSuccess">addUnexpectedSuccess</a></td>
98 <td>Public method called if a test succeeded expectedly.</td>
99 </tr>
100 <tr>
101 <td><a href="#QtTestResult.startTest">startTest</a></td>
102 <td>Public method called at the start of a test.</td>
103 </tr>
104 <tr>
105 <td><a href="#QtTestResult.stopTest">stopTest</a></td>
106 <td>Public method called at the end of a test.</td>
107 </tr>
108 </table>
109 <h3>Static Methods</h3>
110
111 <table>
112 <tr><td>None</td></tr>
113 </table>
114
115 <a NAME="QtTestResult.__init__" ID="QtTestResult.__init__"></a>
116 <h4>QtTestResult (Constructor)</h4>
117 <b>QtTestResult</b>(<i>parent, failfast</i>)
118
119 <p>
120 Constructor
121 </p>
122 <dl>
123
124 <dt><i>parent</i> (UnittestDialog)</dt>
125 <dd>
126 reference to the parent widget
127 </dd>
128 <dt><i>failfast</i> (bool)</dt>
129 <dd>
130 flag indicating to stop at the first error
131 </dd>
132 </dl>
133 <a NAME="QtTestResult.addError" ID="QtTestResult.addError"></a>
134 <h4>QtTestResult.addError</h4>
135 <b>addError</b>(<i>test, err</i>)
136
137 <p>
138 Public method called if a test errored.
139 </p>
140 <dl>
141
142 <dt><i>test</i></dt>
143 <dd>
144 reference to the test object
145 </dd>
146 <dt><i>err</i></dt>
147 <dd>
148 error traceback
149 </dd>
150 </dl>
151 <a NAME="QtTestResult.addExpectedFailure" ID="QtTestResult.addExpectedFailure"></a>
152 <h4>QtTestResult.addExpectedFailure</h4>
153 <b>addExpectedFailure</b>(<i>test, err</i>)
154
155 <p>
156 Public method called if a test failed expected.
157 </p>
158 <dl>
159
160 <dt><i>test</i></dt>
161 <dd>
162 reference to the test object
163 </dd>
164 <dt><i>err</i></dt>
165 <dd>
166 error traceback
167 </dd>
168 </dl>
169 <a NAME="QtTestResult.addFailure" ID="QtTestResult.addFailure"></a>
170 <h4>QtTestResult.addFailure</h4>
171 <b>addFailure</b>(<i>test, err</i>)
172
173 <p>
174 Public method called if a test failed.
175 </p>
176 <dl>
177
178 <dt><i>test</i></dt>
179 <dd>
180 reference to the test object
181 </dd>
182 <dt><i>err</i></dt>
183 <dd>
184 error traceback
185 </dd>
186 </dl>
187 <a NAME="QtTestResult.addSkip" ID="QtTestResult.addSkip"></a>
188 <h4>QtTestResult.addSkip</h4>
189 <b>addSkip</b>(<i>test, reason</i>)
190
191 <p>
192 Public method called if a test was skipped.
193 </p>
194 <dl>
195
196 <dt><i>test</i></dt>
197 <dd>
198 reference to the test object
199 </dd>
200 <dt><i>reason</i></dt>
201 <dd>
202 reason for skipping the test (string)
203 </dd>
204 </dl>
205 <a NAME="QtTestResult.addSubTest" ID="QtTestResult.addSubTest"></a>
206 <h4>QtTestResult.addSubTest</h4>
207 <b>addSubTest</b>(<i>test, subtest, err</i>)
208
209 <p>
210 Public method called for each subtest to record its result.
211 </p>
212 <dl>
213
214 <dt><i>test</i></dt>
215 <dd>
216 reference to the test object
217 </dd>
218 <dt><i>subtest</i></dt>
219 <dd>
220 reference to the subtest object
221 </dd>
222 <dt><i>err</i></dt>
223 <dd>
224 error traceback
225 </dd>
226 </dl>
227 <a NAME="QtTestResult.addUnexpectedSuccess" ID="QtTestResult.addUnexpectedSuccess"></a>
228 <h4>QtTestResult.addUnexpectedSuccess</h4>
229 <b>addUnexpectedSuccess</b>(<i>test</i>)
230
231 <p>
232 Public method called if a test succeeded expectedly.
233 </p>
234 <dl>
235
236 <dt><i>test</i></dt>
237 <dd>
238 reference to the test object
239 </dd>
240 </dl>
241 <a NAME="QtTestResult.startTest" ID="QtTestResult.startTest"></a>
242 <h4>QtTestResult.startTest</h4>
243 <b>startTest</b>(<i>test</i>)
244
245 <p>
246 Public method called at the start of a test.
247 </p>
248 <dl>
249
250 <dt><i>test</i></dt>
251 <dd>
252 Reference to the test object
253 </dd>
254 </dl>
255 <a NAME="QtTestResult.stopTest" ID="QtTestResult.stopTest"></a>
256 <h4>QtTestResult.stopTest</h4>
257 <b>stopTest</b>(<i>test</i>)
258
259 <p>
260 Public method called at the end of a test.
261 </p>
262 <dl>
263
264 <dt><i>test</i></dt>
265 <dd>
266 Reference to the test object
267 </dd>
268 </dl>
269 <div align="right"><a href="#top">Up</a></div>
270 <hr />
271 <hr />
272 <a NAME="UnittestDialog" ID="UnittestDialog"></a>
273 <h2>UnittestDialog</h2>
274
275 <p>
276 Class implementing the UI to the pyunit package.
277 </p>
278 <h3>Signals</h3>
279 <dl>
280
281 <dt>unittestFile(str, int, bool)</dt>
282 <dd>
283 emitted to show the source of a
284 unittest file
285 </dd>
286 <dt>unittestStopped()</dt>
287 <dd>
288 emitted after a unit test was run
289 </dd>
290 </dl>
291 <h3>Derived from</h3>
292 QWidget, Ui_UnittestDialog
293 <h3>Class Attributes</h3>
294
295 <table>
296 <tr><td>ErrorsInfoRole</td></tr><tr><td>FailedExpectedColorDarkTheme</td></tr><tr><td>FailedExpectedColorLightTheme</td></tr><tr><td>SkippedColorDarkTheme</td></tr><tr><td>SkippedColorLightTheme</td></tr><tr><td>SucceededUnexpectedColorDarkTheme</td></tr><tr><td>SucceededUnexpectedColorLightTheme</td></tr><tr><td>TestCaseFileRole</td></tr><tr><td>TestCaseNameRole</td></tr>
297 </table>
298 <h3>Class Methods</h3>
299
300 <table>
301 <tr><td>None</td></tr>
302 </table>
303 <h3>Methods</h3>
304
305 <table>
306
307 <tr>
308 <td><a href="#UnittestDialog.__init__">UnittestDialog</a></td>
309 <td>Constructor</td>
310 </tr>
311 <tr>
312 <td><a href="#UnittestDialog.__UTDiscovered">__UTDiscovered</a></td>
313 <td>Private slot to handle the utDiscovered signal.</td>
314 </tr>
315 <tr>
316 <td><a href="#UnittestDialog.__UTPrepared">__UTPrepared</a></td>
317 <td>Private slot to handle the utPrepared signal.</td>
318 </tr>
319 <tr>
320 <td><a href="#UnittestDialog.__assembleTestCasesList">__assembleTestCasesList</a></td>
321 <td>Private method to assemble a list of test cases included in a test suite.</td>
322 </tr>
323 <tr>
324 <td><a href="#UnittestDialog.__discover">__discover</a></td>
325 <td>Private slot to discover unit test but don't run them.</td>
326 </tr>
327 <tr>
328 <td><a href="#UnittestDialog.__findDiscoveryItem">__findDiscoveryItem</a></td>
329 <td>Private method to find an item given the module path.</td>
330 </tr>
331 <tr>
332 <td><a href="#UnittestDialog.__loadRecent">__loadRecent</a></td>
333 <td>Private method to load the most recently used lists.</td>
334 </tr>
335 <tr>
336 <td><a href="#UnittestDialog.__openEditor">__openEditor</a></td>
337 <td>Private method to open an editor window for the given file.</td>
338 </tr>
339 <tr>
340 <td><a href="#UnittestDialog.__populateDiscoveryResults">__populateDiscoveryResults</a></td>
341 <td>Private method to populate the test discovery results list.</td>
342 </tr>
343 <tr>
344 <td><a href="#UnittestDialog.__populateVenvComboBox">__populateVenvComboBox</a></td>
345 <td>Private method to (re-)populate the virtual environments selector.</td>
346 </tr>
347 <tr>
348 <td><a href="#UnittestDialog.__saveRecent">__saveRecent</a></td>
349 <td>Private method to save the most recently used lists.</td>
350 </tr>
351 <tr>
352 <td><a href="#UnittestDialog.__selectedTestCases">__selectedTestCases</a></td>
353 <td>Private method to assemble the list of selected test cases and suites.</td>
354 </tr>
355 <tr>
356 <td><a href="#UnittestDialog.__setProgressColor">__setProgressColor</a></td>
357 <td>Private method to set the color of the progress color label.</td>
358 </tr>
359 <tr>
360 <td><a href="#UnittestDialog.__setRunningMode">__setRunningMode</a></td>
361 <td>Private method to set the GUI in running mode.</td>
362 </tr>
363 <tr>
364 <td><a href="#UnittestDialog.__setStoppedMode">__setStoppedMode</a></td>
365 <td>Private method to set the GUI in stopped mode.</td>
366 </tr>
367 <tr>
368 <td><a href="#UnittestDialog.__showSource">__showSource</a></td>
369 <td>Private slot to show the source of a traceback in an eric editor.</td>
370 </tr>
371 <tr>
372 <td><a href="#UnittestDialog.__stopTests">__stopTests</a></td>
373 <td>Private slot to stop the test.</td>
374 </tr>
375 <tr>
376 <td><a href="#UnittestDialog.clearRecent">clearRecent</a></td>
377 <td>Public slot to clear the recently used lists.</td>
378 </tr>
379 <tr>
380 <td><a href="#UnittestDialog.closeEvent">closeEvent</a></td>
381 <td>Protected method to handle the close event.</td>
382 </tr>
383 <tr>
384 <td><a href="#UnittestDialog.hasFailedTests">hasFailedTests</a></td>
385 <td>Public method to check, if there are failed tests from the last run.</td>
386 </tr>
387 <tr>
388 <td><a href="#UnittestDialog.insertDiscovery">insertDiscovery</a></td>
389 <td>Public slot to insert the discovery start directory into the discoveryPicker object.</td>
390 </tr>
391 <tr>
392 <td><a href="#UnittestDialog.insertProg">insertProg</a></td>
393 <td>Public slot to insert the filename prog into the testsuitePicker object.</td>
394 </tr>
395 <tr>
396 <td><a href="#UnittestDialog.insertTestName">insertTestName</a></td>
397 <td>Public slot to insert a test name into the testComboBox object.</td>
398 </tr>
399 <tr>
400 <td><a href="#UnittestDialog.keyPressEvent">keyPressEvent</a></td>
401 <td>Protected slot to handle key press events.</td>
402 </tr>
403 <tr>
404 <td><a href="#UnittestDialog.on_buttonBox_clicked">on_buttonBox_clicked</a></td>
405 <td>Private slot called by a button of the button box clicked.</td>
406 </tr>
407 <tr>
408 <td><a href="#UnittestDialog.on_discoverCheckBox_toggled">on_discoverCheckBox_toggled</a></td>
409 <td>Private slot handling state changes of the 'discover' checkbox.</td>
410 </tr>
411 <tr>
412 <td><a href="#UnittestDialog.on_discoveryList_itemChanged">on_discoveryList_itemChanged</a></td>
413 <td>Private slot handling the user checking or unchecking an item.</td>
414 </tr>
415 <tr>
416 <td><a href="#UnittestDialog.on_discoveryList_itemDoubleClicked">on_discoveryList_itemDoubleClicked</a></td>
417 <td>Private slot handling the user double clicking an item.</td>
418 </tr>
419 <tr>
420 <td><a href="#UnittestDialog.on_errorsListWidget_currentTextChanged">on_errorsListWidget_currentTextChanged</a></td>
421 <td>Private slot to handle the highlighted signal.</td>
422 </tr>
423 <tr>
424 <td><a href="#UnittestDialog.on_errorsListWidget_itemDoubleClicked">on_errorsListWidget_itemDoubleClicked</a></td>
425 <td>Private slot called by doubleclicking an errorlist entry.</td>
426 </tr>
427 <tr>
428 <td><a href="#UnittestDialog.on_testsuitePicker_aboutToShowPathPickerDialog">on_testsuitePicker_aboutToShowPathPickerDialog</a></td>
429 <td>Private slot called before the test suite selection dialog is shown.</td>
430 </tr>
431 <tr>
432 <td><a href="#UnittestDialog.on_testsuitePicker_editTextChanged">on_testsuitePicker_editTextChanged</a></td>
433 <td>Private slot handling changes of the test suite path.</td>
434 </tr>
435 <tr>
436 <td><a href="#UnittestDialog.on_testsuitePicker_pathSelected">on_testsuitePicker_pathSelected</a></td>
437 <td>Private slot called after a test suite has been selected.</td>
438 </tr>
439 <tr>
440 <td><a href="#UnittestDialog.setProjectMode">setProjectMode</a></td>
441 <td>Public method to set the project mode of the dialog.</td>
442 </tr>
443 <tr>
444 <td><a href="#UnittestDialog.startTests">startTests</a></td>
445 <td>Public slot to start the test.</td>
446 </tr>
447 <tr>
448 <td><a href="#UnittestDialog.testErrored">testErrored</a></td>
449 <td>Public method called if a test errors.</td>
450 </tr>
451 <tr>
452 <td><a href="#UnittestDialog.testFailed">testFailed</a></td>
453 <td>Public method called if a test fails.</td>
454 </tr>
455 <tr>
456 <td><a href="#UnittestDialog.testFailedExpected">testFailedExpected</a></td>
457 <td>Public method called if a test fails as expected.</td>
458 </tr>
459 <tr>
460 <td><a href="#UnittestDialog.testFinished">testFinished</a></td>
461 <td>Public method called if a test has finished.</td>
462 </tr>
463 <tr>
464 <td><a href="#UnittestDialog.testSkipped">testSkipped</a></td>
465 <td>Public method called if a test was skipped.</td>
466 </tr>
467 <tr>
468 <td><a href="#UnittestDialog.testStarted">testStarted</a></td>
469 <td>Public method called if a test is about to be run.</td>
470 </tr>
471 <tr>
472 <td><a href="#UnittestDialog.testSucceededUnexpected">testSucceededUnexpected</a></td>
473 <td>Public method called if a test succeeds unexpectedly.</td>
474 </tr>
475 </table>
476 <h3>Static Methods</h3>
477
478 <table>
479 <tr><td>None</td></tr>
480 </table>
481
482 <a NAME="UnittestDialog.__init__" ID="UnittestDialog.__init__"></a>
483 <h4>UnittestDialog (Constructor)</h4>
484 <b>UnittestDialog</b>(<i>prog=None, dbs=None, ui=None, parent=None, name=None</i>)
485
486 <p>
487 Constructor
488 </p>
489 <dl>
490
491 <dt><i>prog</i> (str)</dt>
492 <dd>
493 filename of the program to open
494 </dd>
495 <dt><i>dbs</i> (DebugServer)</dt>
496 <dd>
497 reference to the debug server object. It is an indication
498 whether we were called from within the eric IDE.
499 </dd>
500 <dt><i>ui</i> (UserInterface)</dt>
501 <dd>
502 reference to the UI object
503 </dd>
504 <dt><i>parent</i> (QWidget)</dt>
505 <dd>
506 parent widget of this dialog
507 </dd>
508 <dt><i>name</i> (str)</dt>
509 <dd>
510 name of this dialog
511 </dd>
512 </dl>
513 <a NAME="UnittestDialog.__UTDiscovered" ID="UnittestDialog.__UTDiscovered"></a>
514 <h4>UnittestDialog.__UTDiscovered</h4>
515 <b>__UTDiscovered</b>(<i>testCases, exc_type, exc_value</i>)
516
517 <p>
518 Private slot to handle the utDiscovered signal.
519 </p>
520 <p>
521 If the unittest suite was loaded successfully, we ask the
522 client to run the test suite.
523 </p>
524 <dl>
525
526 <dt><i>testCases</i> (str)</dt>
527 <dd>
528 list of detected test cases
529 </dd>
530 <dt><i>exc_type</i> (str)</dt>
531 <dd>
532 exception type occured during discovery
533 </dd>
534 <dt><i>exc_value</i> (str)</dt>
535 <dd>
536 value of exception occured during discovery
537 </dd>
538 </dl>
539 <a NAME="UnittestDialog.__UTPrepared" ID="UnittestDialog.__UTPrepared"></a>
540 <h4>UnittestDialog.__UTPrepared</h4>
541 <b>__UTPrepared</b>(<i>nrTests, exc_type, exc_value</i>)
542
543 <p>
544 Private slot to handle the utPrepared signal.
545 </p>
546 <p>
547 If the unittest suite was loaded successfully, we ask the
548 client to run the test suite.
549 </p>
550 <dl>
551
552 <dt><i>nrTests</i></dt>
553 <dd>
554 number of tests contained in the test suite (integer)
555 </dd>
556 <dt><i>exc_type</i></dt>
557 <dd>
558 type of exception occured during preparation (string)
559 </dd>
560 <dt><i>exc_value</i></dt>
561 <dd>
562 value of exception occured during preparation (string)
563 </dd>
564 </dl>
565 <a NAME="UnittestDialog.__assembleTestCasesList" ID="UnittestDialog.__assembleTestCasesList"></a>
566 <h4>UnittestDialog.__assembleTestCasesList</h4>
567 <b>__assembleTestCasesList</b>(<i>suite, start</i>)
568
569 <p>
570 Private method to assemble a list of test cases included in a test
571 suite.
572 </p>
573 <dl>
574
575 <dt><i>suite</i> (unittest.TestSuite)</dt>
576 <dd>
577 test suite to be inspected
578 </dd>
579 <dt><i>start</i> (str)</dt>
580 <dd>
581 name of directory discovery was started at
582 </dd>
583 </dl>
584 <dl>
585 <dt>Return:</dt>
586 <dd>
587 list of tuples containing the test case ID, a short description
588 and the path of the test file name
589 </dd>
590 </dl>
591 <dl>
592 <dt>Return Type:</dt>
593 <dd>
594 list of tuples of (str, str, str)
595 </dd>
596 </dl>
597 <a NAME="UnittestDialog.__discover" ID="UnittestDialog.__discover"></a>
598 <h4>UnittestDialog.__discover</h4>
599 <b>__discover</b>(<i></i>)
600
601 <p>
602 Private slot to discover unit test but don't run them.
603 </p>
604 <a NAME="UnittestDialog.__findDiscoveryItem" ID="UnittestDialog.__findDiscoveryItem"></a>
605 <h4>UnittestDialog.__findDiscoveryItem</h4>
606 <b>__findDiscoveryItem</b>(<i>modulePath</i>)
607
608 <p>
609 Private method to find an item given the module path.
610 </p>
611 <dl>
612
613 <dt><i>modulePath</i> (str)</dt>
614 <dd>
615 path of the module in dotted notation
616 </dd>
617 </dl>
618 <dl>
619 <dt>Return:</dt>
620 <dd>
621 reference to the item or None
622 </dd>
623 </dl>
624 <dl>
625 <dt>Return Type:</dt>
626 <dd>
627 QTreeWidgetItem or None
628 </dd>
629 </dl>
630 <a NAME="UnittestDialog.__loadRecent" ID="UnittestDialog.__loadRecent"></a>
631 <h4>UnittestDialog.__loadRecent</h4>
632 <b>__loadRecent</b>(<i></i>)
633
634 <p>
635 Private method to load the most recently used lists.
636 </p>
637 <a NAME="UnittestDialog.__openEditor" ID="UnittestDialog.__openEditor"></a>
638 <h4>UnittestDialog.__openEditor</h4>
639 <b>__openEditor</b>(<i>filename, linenumber</i>)
640
641 <p>
642 Private method to open an editor window for the given file.
643 </p>
644 <p>
645 Note: This method opens an editor window when the unittest dialog
646 is called as a standalone application.
647 </p>
648 <dl>
649
650 <dt><i>filename</i> (str)</dt>
651 <dd>
652 path of the file to be opened
653 </dd>
654 <dt><i>linenumber</i> (int)</dt>
655 <dd>
656 line number to place the cursor at
657 </dd>
658 </dl>
659 <a NAME="UnittestDialog.__populateDiscoveryResults" ID="UnittestDialog.__populateDiscoveryResults"></a>
660 <h4>UnittestDialog.__populateDiscoveryResults</h4>
661 <b>__populateDiscoveryResults</b>(<i>tests</i>)
662
663 <p>
664 Private method to populate the test discovery results list.
665 </p>
666 <dl>
667
668 <dt><i>tests</i> (list of tuples of (str, str, str))</dt>
669 <dd>
670 list of tuples containing the discovery results
671 </dd>
672 </dl>
673 <a NAME="UnittestDialog.__populateVenvComboBox" ID="UnittestDialog.__populateVenvComboBox"></a>
674 <h4>UnittestDialog.__populateVenvComboBox</h4>
675 <b>__populateVenvComboBox</b>(<i></i>)
676
677 <p>
678 Private method to (re-)populate the virtual environments selector.
679 </p>
680 <a NAME="UnittestDialog.__saveRecent" ID="UnittestDialog.__saveRecent"></a>
681 <h4>UnittestDialog.__saveRecent</h4>
682 <b>__saveRecent</b>(<i></i>)
683
684 <p>
685 Private method to save the most recently used lists.
686 </p>
687 <a NAME="UnittestDialog.__selectedTestCases" ID="UnittestDialog.__selectedTestCases"></a>
688 <h4>UnittestDialog.__selectedTestCases</h4>
689 <b>__selectedTestCases</b>(<i>parent=None</i>)
690
691 <p>
692 Private method to assemble the list of selected test cases and suites.
693 </p>
694 <dl>
695
696 <dt><i>parent</i> (QTreeWidgetItem)</dt>
697 <dd>
698 reference to the parent item
699 </dd>
700 </dl>
701 <dl>
702 <dt>Return:</dt>
703 <dd>
704 list of selected test cases
705 </dd>
706 </dl>
707 <dl>
708 <dt>Return Type:</dt>
709 <dd>
710 list of str
711 </dd>
712 </dl>
713 <a NAME="UnittestDialog.__setProgressColor" ID="UnittestDialog.__setProgressColor"></a>
714 <h4>UnittestDialog.__setProgressColor</h4>
715 <b>__setProgressColor</b>(<i>color</i>)
716
717 <p>
718 Private method to set the color of the progress color label.
719 </p>
720 <dl>
721
722 <dt><i>color</i></dt>
723 <dd>
724 colour to be shown (string)
725 </dd>
726 </dl>
727 <a NAME="UnittestDialog.__setRunningMode" ID="UnittestDialog.__setRunningMode"></a>
728 <h4>UnittestDialog.__setRunningMode</h4>
729 <b>__setRunningMode</b>(<i></i>)
730
731 <p>
732 Private method to set the GUI in running mode.
733 </p>
734 <a NAME="UnittestDialog.__setStoppedMode" ID="UnittestDialog.__setStoppedMode"></a>
735 <h4>UnittestDialog.__setStoppedMode</h4>
736 <b>__setStoppedMode</b>(<i></i>)
737
738 <p>
739 Private method to set the GUI in stopped mode.
740 </p>
741 <a NAME="UnittestDialog.__showSource" ID="UnittestDialog.__showSource"></a>
742 <h4>UnittestDialog.__showSource</h4>
743 <b>__showSource</b>(<i></i>)
744
745 <p>
746 Private slot to show the source of a traceback in an eric editor.
747 </p>
748 <a NAME="UnittestDialog.__stopTests" ID="UnittestDialog.__stopTests"></a>
749 <h4>UnittestDialog.__stopTests</h4>
750 <b>__stopTests</b>(<i></i>)
751
752 <p>
753 Private slot to stop the test.
754 </p>
755 <a NAME="UnittestDialog.clearRecent" ID="UnittestDialog.clearRecent"></a>
756 <h4>UnittestDialog.clearRecent</h4>
757 <b>clearRecent</b>(<i></i>)
758
759 <p>
760 Public slot to clear the recently used lists.
761 </p>
762 <a NAME="UnittestDialog.closeEvent" ID="UnittestDialog.closeEvent"></a>
763 <h4>UnittestDialog.closeEvent</h4>
764 <b>closeEvent</b>(<i>event</i>)
765
766 <p>
767 Protected method to handle the close event.
768 </p>
769 <dl>
770
771 <dt><i>event</i> (QCloseEvent)</dt>
772 <dd>
773 close event
774 </dd>
775 </dl>
776 <a NAME="UnittestDialog.hasFailedTests" ID="UnittestDialog.hasFailedTests"></a>
777 <h4>UnittestDialog.hasFailedTests</h4>
778 <b>hasFailedTests</b>(<i></i>)
779
780 <p>
781 Public method to check, if there are failed tests from the last run.
782 </p>
783 <dl>
784 <dt>Return:</dt>
785 <dd>
786 flag indicating the presence of failed tests (boolean)
787 </dd>
788 </dl>
789 <a NAME="UnittestDialog.insertDiscovery" ID="UnittestDialog.insertDiscovery"></a>
790 <h4>UnittestDialog.insertDiscovery</h4>
791 <b>insertDiscovery</b>(<i>start</i>)
792
793 <p>
794 Public slot to insert the discovery start directory into the
795 discoveryPicker object.
796 </p>
797 <dl>
798
799 <dt><i>start</i> (str)</dt>
800 <dd>
801 start directory name to be inserted
802 </dd>
803 </dl>
804 <a NAME="UnittestDialog.insertProg" ID="UnittestDialog.insertProg"></a>
805 <h4>UnittestDialog.insertProg</h4>
806 <b>insertProg</b>(<i>prog</i>)
807
808 <p>
809 Public slot to insert the filename prog into the testsuitePicker
810 object.
811 </p>
812 <dl>
813
814 <dt><i>prog</i></dt>
815 <dd>
816 filename to be inserted (string)
817 </dd>
818 </dl>
819 <a NAME="UnittestDialog.insertTestName" ID="UnittestDialog.insertTestName"></a>
820 <h4>UnittestDialog.insertTestName</h4>
821 <b>insertTestName</b>(<i>testName</i>)
822
823 <p>
824 Public slot to insert a test name into the testComboBox object.
825 </p>
826 <dl>
827
828 <dt><i>testName</i></dt>
829 <dd>
830 name of the test to be inserted (string)
831 </dd>
832 </dl>
833 <a NAME="UnittestDialog.keyPressEvent" ID="UnittestDialog.keyPressEvent"></a>
834 <h4>UnittestDialog.keyPressEvent</h4>
835 <b>keyPressEvent</b>(<i>evt</i>)
836
837 <p>
838 Protected slot to handle key press events.
839 </p>
840 <dl>
841
842 <dt><i>evt</i></dt>
843 <dd>
844 key press event to handle (QKeyEvent)
845 </dd>
846 </dl>
847 <a NAME="UnittestDialog.on_buttonBox_clicked" ID="UnittestDialog.on_buttonBox_clicked"></a>
848 <h4>UnittestDialog.on_buttonBox_clicked</h4>
849 <b>on_buttonBox_clicked</b>(<i>button</i>)
850
851 <p>
852 Private slot called by a button of the button box clicked.
853 </p>
854 <dl>
855
856 <dt><i>button</i></dt>
857 <dd>
858 button that was clicked (QAbstractButton)
859 </dd>
860 </dl>
861 <a NAME="UnittestDialog.on_discoverCheckBox_toggled" ID="UnittestDialog.on_discoverCheckBox_toggled"></a>
862 <h4>UnittestDialog.on_discoverCheckBox_toggled</h4>
863 <b>on_discoverCheckBox_toggled</b>(<i>checked</i>)
864
865 <p>
866 Private slot handling state changes of the 'discover' checkbox.
867 </p>
868 <dl>
869
870 <dt><i>checked</i> (bool)</dt>
871 <dd>
872 state of the checkbox
873 </dd>
874 </dl>
875 <a NAME="UnittestDialog.on_discoveryList_itemChanged" ID="UnittestDialog.on_discoveryList_itemChanged"></a>
876 <h4>UnittestDialog.on_discoveryList_itemChanged</h4>
877 <b>on_discoveryList_itemChanged</b>(<i>item, column</i>)
878
879 <p>
880 Private slot handling the user checking or unchecking an item.
881 </p>
882 <dl>
883
884 <dt><i>item</i> (QTreeWidgetItem)</dt>
885 <dd>
886 reference to the item
887 </dd>
888 <dt><i>column</i> (int)</dt>
889 <dd>
890 changed column
891 </dd>
892 </dl>
893 <a NAME="UnittestDialog.on_discoveryList_itemDoubleClicked" ID="UnittestDialog.on_discoveryList_itemDoubleClicked"></a>
894 <h4>UnittestDialog.on_discoveryList_itemDoubleClicked</h4>
895 <b>on_discoveryList_itemDoubleClicked</b>(<i>item, column</i>)
896
897 <p>
898 Private slot handling the user double clicking an item.
899 </p>
900 <dl>
901
902 <dt><i>item</i> (QTreeWidgetItem)</dt>
903 <dd>
904 reference to the item
905 </dd>
906 <dt><i>column</i> (int)</dt>
907 <dd>
908 column of the double click
909 </dd>
910 </dl>
911 <a NAME="UnittestDialog.on_errorsListWidget_currentTextChanged" ID="UnittestDialog.on_errorsListWidget_currentTextChanged"></a>
912 <h4>UnittestDialog.on_errorsListWidget_currentTextChanged</h4>
913 <b>on_errorsListWidget_currentTextChanged</b>(<i>text</i>)
914
915 <p>
916 Private slot to handle the highlighted signal.
917 </p>
918 <dl>
919
920 <dt><i>text</i></dt>
921 <dd>
922 current text (string)
923 </dd>
924 </dl>
925 <a NAME="UnittestDialog.on_errorsListWidget_itemDoubleClicked" ID="UnittestDialog.on_errorsListWidget_itemDoubleClicked"></a>
926 <h4>UnittestDialog.on_errorsListWidget_itemDoubleClicked</h4>
927 <b>on_errorsListWidget_itemDoubleClicked</b>(<i>lbitem</i>)
928
929 <p>
930 Private slot called by doubleclicking an errorlist entry.
931 </p>
932 <p>
933 It will popup a dialog showing the stacktrace.
934 If called from eric, an additional button is displayed
935 to show the python source in an eric source viewer (in
936 erics main window.
937 </p>
938 <dl>
939
940 <dt><i>lbitem</i></dt>
941 <dd>
942 the listbox item that was double clicked
943 </dd>
944 </dl>
945 <a NAME="UnittestDialog.on_testsuitePicker_aboutToShowPathPickerDialog" ID="UnittestDialog.on_testsuitePicker_aboutToShowPathPickerDialog"></a>
946 <h4>UnittestDialog.on_testsuitePicker_aboutToShowPathPickerDialog</h4>
947 <b>on_testsuitePicker_aboutToShowPathPickerDialog</b>(<i></i>)
948
949 <p>
950 Private slot called before the test suite selection dialog is shown.
951 </p>
952 <a NAME="UnittestDialog.on_testsuitePicker_editTextChanged" ID="UnittestDialog.on_testsuitePicker_editTextChanged"></a>
953 <h4>UnittestDialog.on_testsuitePicker_editTextChanged</h4>
954 <b>on_testsuitePicker_editTextChanged</b>(<i>path</i>)
955
956 <p>
957 Private slot handling changes of the test suite path.
958 </p>
959 <dl>
960
961 <dt><i>path</i> (str)</dt>
962 <dd>
963 path of the test suite file
964 </dd>
965 </dl>
966 <a NAME="UnittestDialog.on_testsuitePicker_pathSelected" ID="UnittestDialog.on_testsuitePicker_pathSelected"></a>
967 <h4>UnittestDialog.on_testsuitePicker_pathSelected</h4>
968 <b>on_testsuitePicker_pathSelected</b>(<i>suite</i>)
969
970 <p>
971 Private slot called after a test suite has been selected.
972 </p>
973 <dl>
974
975 <dt><i>suite</i> (str)</dt>
976 <dd>
977 file name of the test suite
978 </dd>
979 </dl>
980 <a NAME="UnittestDialog.setProjectMode" ID="UnittestDialog.setProjectMode"></a>
981 <h4>UnittestDialog.setProjectMode</h4>
982 <b>setProjectMode</b>(<i>forProject</i>)
983
984 <p>
985 Public method to set the project mode of the dialog.
986 </p>
987 <dl>
988
989 <dt><i>forProject</i> (bool)</dt>
990 <dd>
991 flag indicating to run for the open project
992 </dd>
993 </dl>
994 <a NAME="UnittestDialog.startTests" ID="UnittestDialog.startTests"></a>
995 <h4>UnittestDialog.startTests</h4>
996 <b>startTests</b>(<i>failedOnly=False</i>)
997
998 <p>
999 Public slot to start the test.
1000 </p>
1001 <dl>
1002
1003 <dt><i>failedOnly</i></dt>
1004 <dd>
1005 flag indicating to run only failed tests (boolean)
1006 </dd>
1007 </dl>
1008 <a NAME="UnittestDialog.testErrored" ID="UnittestDialog.testErrored"></a>
1009 <h4>UnittestDialog.testErrored</h4>
1010 <b>testErrored</b>(<i>test, exc, testId</i>)
1011
1012 <p>
1013 Public method called if a test errors.
1014 </p>
1015 <dl>
1016
1017 <dt><i>test</i></dt>
1018 <dd>
1019 name of the test (string)
1020 </dd>
1021 <dt><i>exc</i></dt>
1022 <dd>
1023 string representation of the exception (string)
1024 </dd>
1025 <dt><i>testId</i></dt>
1026 <dd>
1027 id of the test (string)
1028 </dd>
1029 </dl>
1030 <a NAME="UnittestDialog.testFailed" ID="UnittestDialog.testFailed"></a>
1031 <h4>UnittestDialog.testFailed</h4>
1032 <b>testFailed</b>(<i>test, exc, testId</i>)
1033
1034 <p>
1035 Public method called if a test fails.
1036 </p>
1037 <dl>
1038
1039 <dt><i>test</i></dt>
1040 <dd>
1041 name of the test (string)
1042 </dd>
1043 <dt><i>exc</i></dt>
1044 <dd>
1045 string representation of the exception (string)
1046 </dd>
1047 <dt><i>testId</i></dt>
1048 <dd>
1049 id of the test (string)
1050 </dd>
1051 </dl>
1052 <a NAME="UnittestDialog.testFailedExpected" ID="UnittestDialog.testFailedExpected"></a>
1053 <h4>UnittestDialog.testFailedExpected</h4>
1054 <b>testFailedExpected</b>(<i>test, exc, testId</i>)
1055
1056 <p>
1057 Public method called if a test fails as expected.
1058 </p>
1059 <dl>
1060
1061 <dt><i>test</i></dt>
1062 <dd>
1063 name of the test (string)
1064 </dd>
1065 <dt><i>exc</i></dt>
1066 <dd>
1067 string representation of the exception (string)
1068 </dd>
1069 <dt><i>testId</i></dt>
1070 <dd>
1071 id of the test (string)
1072 </dd>
1073 </dl>
1074 <a NAME="UnittestDialog.testFinished" ID="UnittestDialog.testFinished"></a>
1075 <h4>UnittestDialog.testFinished</h4>
1076 <b>testFinished</b>(<i></i>)
1077
1078 <p>
1079 Public method called if a test has finished.
1080 </p>
1081 <p>
1082 <b>Note</b>: It is also called if it has already failed or errored.
1083 </p>
1084 <a NAME="UnittestDialog.testSkipped" ID="UnittestDialog.testSkipped"></a>
1085 <h4>UnittestDialog.testSkipped</h4>
1086 <b>testSkipped</b>(<i>test, reason, testId</i>)
1087
1088 <p>
1089 Public method called if a test was skipped.
1090 </p>
1091 <dl>
1092
1093 <dt><i>test</i></dt>
1094 <dd>
1095 name of the test (string)
1096 </dd>
1097 <dt><i>reason</i></dt>
1098 <dd>
1099 reason for skipping the test (string)
1100 </dd>
1101 <dt><i>testId</i></dt>
1102 <dd>
1103 id of the test (string)
1104 </dd>
1105 </dl>
1106 <a NAME="UnittestDialog.testStarted" ID="UnittestDialog.testStarted"></a>
1107 <h4>UnittestDialog.testStarted</h4>
1108 <b>testStarted</b>(<i>test, doc</i>)
1109
1110 <p>
1111 Public method called if a test is about to be run.
1112 </p>
1113 <dl>
1114
1115 <dt><i>test</i></dt>
1116 <dd>
1117 name of the started test (string)
1118 </dd>
1119 <dt><i>doc</i></dt>
1120 <dd>
1121 documentation of the started test (string)
1122 </dd>
1123 </dl>
1124 <a NAME="UnittestDialog.testSucceededUnexpected" ID="UnittestDialog.testSucceededUnexpected"></a>
1125 <h4>UnittestDialog.testSucceededUnexpected</h4>
1126 <b>testSucceededUnexpected</b>(<i>test, testId</i>)
1127
1128 <p>
1129 Public method called if a test succeeds unexpectedly.
1130 </p>
1131 <dl>
1132
1133 <dt><i>test</i></dt>
1134 <dd>
1135 name of the test (string)
1136 </dd>
1137 <dt><i>testId</i></dt>
1138 <dd>
1139 id of the test (string)
1140 </dd>
1141 </dl>
1142 <div align="right"><a href="#top">Up</a></div>
1143 <hr />
1144 <hr />
1145 <a NAME="UnittestWindow" ID="UnittestWindow"></a>
1146 <h2>UnittestWindow</h2>
1147
1148 <p>
1149 Main window class for the standalone dialog.
1150 </p>
1151 <h3>Derived from</h3>
1152 EricMainWindow
1153 <h3>Class Attributes</h3>
1154
1155 <table>
1156 <tr><td>None</td></tr>
1157 </table>
1158 <h3>Class Methods</h3>
1159
1160 <table>
1161 <tr><td>None</td></tr>
1162 </table>
1163 <h3>Methods</h3>
1164
1165 <table>
1166
1167 <tr>
1168 <td><a href="#UnittestWindow.__init__">UnittestWindow</a></td>
1169 <td>Constructor</td>
1170 </tr>
1171 <tr>
1172 <td><a href="#UnittestWindow.eventFilter">eventFilter</a></td>
1173 <td>Public method to filter events.</td>
1174 </tr>
1175 </table>
1176 <h3>Static Methods</h3>
1177
1178 <table>
1179 <tr><td>None</td></tr>
1180 </table>
1181
1182 <a NAME="UnittestWindow.__init__" ID="UnittestWindow.__init__"></a>
1183 <h4>UnittestWindow (Constructor)</h4>
1184 <b>UnittestWindow</b>(<i>prog=None, parent=None</i>)
1185
1186 <p>
1187 Constructor
1188 </p>
1189 <dl>
1190
1191 <dt><i>prog</i></dt>
1192 <dd>
1193 filename of the program to open
1194 </dd>
1195 <dt><i>parent</i></dt>
1196 <dd>
1197 reference to the parent widget (QWidget)
1198 </dd>
1199 </dl>
1200 <a NAME="UnittestWindow.eventFilter" ID="UnittestWindow.eventFilter"></a>
1201 <h4>UnittestWindow.eventFilter</h4>
1202 <b>eventFilter</b>(<i>obj, event</i>)
1203
1204 <p>
1205 Public method to filter events.
1206 </p>
1207 <dl>
1208
1209 <dt><i>obj</i></dt>
1210 <dd>
1211 reference to the object the event is meant for (QObject)
1212 </dd>
1213 <dt><i>event</i></dt>
1214 <dd>
1215 reference to the event object (QEvent)
1216 </dd>
1217 </dl>
1218 <dl>
1219 <dt>Return:</dt>
1220 <dd>
1221 flag indicating, whether the event was handled (boolean)
1222 </dd>
1223 </dl>
1224 <div align="right"><a href="#top">Up</a></div>
1225 <hr />
1226 <hr />
1227 <a NAME="clearSavedHistories" ID="clearSavedHistories"></a>
1228 <h2>clearSavedHistories</h2>
1229 <b>clearSavedHistories</b>(<i>self</i>)
1230
1231 <p>
1232 Function to clear the saved history lists.
1233 </p>
1234 <div align="right"><a href="#top">Up</a></div>
1235 <hr />
1236 </body></html>

eric ide

mercurial