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

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

eric ide

mercurial