5 <link rel="stylesheet" href="styles.css"> |
5 <link rel="stylesheet" href="styles.css"> |
6 </head> |
6 </head> |
7 <body> |
7 <body> |
8 <a NAME="top" ID="top"></a> |
8 <a NAME="top" ID="top"></a> |
9 <h1>eric7.Testing.Interfaces.PytestExecutor</h1> |
9 <h1>eric7.Testing.Interfaces.PytestExecutor</h1> |
10 |
|
11 <p> |
10 <p> |
12 Module implementing the executor for the 'pytest' framework. |
11 Module implementing the executor for the 'pytest' framework. |
13 </p> |
12 </p> |
|
13 |
14 <h3>Global Attributes</h3> |
14 <h3>Global Attributes</h3> |
15 |
|
16 <table> |
15 <table> |
17 <tr><td>None</td></tr> |
16 <tr><td>None</td></tr> |
18 </table> |
17 </table> |
|
18 |
19 <h3>Classes</h3> |
19 <h3>Classes</h3> |
20 |
20 <table> |
21 <table> |
|
22 |
|
23 <tr> |
21 <tr> |
24 <td><a href="#PytestExecutor">PytestExecutor</a></td> |
22 <td><a href="#PytestExecutor">PytestExecutor</a></td> |
25 <td>Class implementing the executor for the 'pytest' framework.</td> |
23 <td>Class implementing the executor for the 'pytest' framework.</td> |
26 </tr> |
24 </tr> |
27 </table> |
25 </table> |
|
26 |
28 <h3>Functions</h3> |
27 <h3>Functions</h3> |
29 |
|
30 <table> |
28 <table> |
31 <tr><td>None</td></tr> |
29 <tr><td>None</td></tr> |
32 </table> |
30 </table> |
|
31 |
33 <hr /> |
32 <hr /> |
34 <hr /> |
33 <hr /> |
35 <a NAME="PytestExecutor" ID="PytestExecutor"></a> |
34 <a NAME="PytestExecutor" ID="PytestExecutor"></a> |
36 <h2>PytestExecutor</h2> |
35 <h2>PytestExecutor</h2> |
37 |
|
38 <p> |
36 <p> |
39 Class implementing the executor for the 'pytest' framework. |
37 Class implementing the executor for the 'pytest' framework. |
40 </p> |
38 </p> |
|
39 |
41 <h3>Derived from</h3> |
40 <h3>Derived from</h3> |
42 TestExecutorBase |
41 TestExecutorBase |
43 <h3>Class Attributes</h3> |
42 <h3>Class Attributes</h3> |
44 |
43 <table> |
45 <table> |
44 <tr><td>module</td></tr> |
46 <tr><td>module</td></tr><tr><td>name</td></tr><tr><td>runner</td></tr> |
45 <tr><td>name</td></tr> |
47 </table> |
46 <tr><td>runner</td></tr> |
|
47 </table> |
|
48 |
48 <h3>Class Methods</h3> |
49 <h3>Class Methods</h3> |
49 |
|
50 <table> |
50 <table> |
51 <tr><td>None</td></tr> |
51 <tr><td>None</td></tr> |
52 </table> |
52 </table> |
|
53 |
53 <h3>Methods</h3> |
54 <h3>Methods</h3> |
54 |
55 <table> |
55 <table> |
|
56 |
|
57 <tr> |
56 <tr> |
58 <td><a href="#PytestExecutor.__init__">PytestExecutor</a></td> |
57 <td><a href="#PytestExecutor.__init__">PytestExecutor</a></td> |
59 <td>Constructor</td> |
58 <td>Constructor</td> |
60 </tr> |
59 </tr> |
61 <tr> |
60 <tr> |
113 <tr> |
112 <tr> |
114 <td><a href="#PytestExecutor.supportsPatterns">supportsPatterns</a></td> |
113 <td><a href="#PytestExecutor.supportsPatterns">supportsPatterns</a></td> |
115 <td>Public method to indicate the support for test filtering using test name patterns or a test name pattern expression.</td> |
114 <td>Public method to indicate the support for test filtering using test name patterns or a test name pattern expression.</td> |
116 </tr> |
115 </tr> |
117 </table> |
116 </table> |
|
117 |
118 <h3>Static Methods</h3> |
118 <h3>Static Methods</h3> |
119 |
|
120 <table> |
119 <table> |
121 <tr><td>None</td></tr> |
120 <tr><td>None</td></tr> |
122 </table> |
121 </table> |
|
122 |
123 |
123 |
124 <a NAME="PytestExecutor.__init__" ID="PytestExecutor.__init__"></a> |
124 <a NAME="PytestExecutor.__init__" ID="PytestExecutor.__init__"></a> |
125 <h4>PytestExecutor (Constructor)</h4> |
125 <h4>PytestExecutor (Constructor)</h4> |
126 <b>PytestExecutor</b>(<i>testWidget</i>) |
126 <b>PytestExecutor</b>(<i>testWidget</i>) |
127 |
|
128 <p> |
127 <p> |
129 Constructor |
128 Constructor |
130 </p> |
129 </p> |
|
130 |
131 <dl> |
131 <dl> |
132 |
132 |
133 <dt><i>testWidget</i> (TestingWidget)</dt> |
133 <dt><i>testWidget</i> (TestingWidget)</dt> |
134 <dd> |
134 <dd> |
135 reference to the unit test widget |
135 reference to the unit test widget |
136 </dd> |
136 </dd> |
137 </dl> |
137 </dl> |
138 <a NAME="PytestExecutor.__nodeid2testname" ID="PytestExecutor.__nodeid2testname"></a> |
138 <a NAME="PytestExecutor.__nodeid2testname" ID="PytestExecutor.__nodeid2testname"></a> |
139 <h4>PytestExecutor.__nodeid2testname</h4> |
139 <h4>PytestExecutor.__nodeid2testname</h4> |
140 <b>__nodeid2testname</b>(<i>nodeid</i>) |
140 <b>__nodeid2testname</b>(<i>nodeid</i>) |
141 |
|
142 <p> |
141 <p> |
143 Private method to convert a nodeid to a test name. |
142 Private method to convert a nodeid to a test name. |
144 </p> |
143 </p> |
|
144 |
145 <dl> |
145 <dl> |
146 |
146 |
147 <dt><i>nodeid</i> (str)</dt> |
147 <dt><i>nodeid</i> (str)</dt> |
148 <dd> |
148 <dd> |
149 nodeid to be converted |
149 nodeid to be converted |
162 </dd> |
162 </dd> |
163 </dl> |
163 </dl> |
164 <a NAME="PytestExecutor.__nodeid2testpath" ID="PytestExecutor.__nodeid2testpath"></a> |
164 <a NAME="PytestExecutor.__nodeid2testpath" ID="PytestExecutor.__nodeid2testpath"></a> |
165 <h4>PytestExecutor.__nodeid2testpath</h4> |
165 <h4>PytestExecutor.__nodeid2testpath</h4> |
166 <b>__nodeid2testpath</b>(<i>nodeid</i>) |
166 <b>__nodeid2testpath</b>(<i>nodeid</i>) |
167 |
|
168 <p> |
167 <p> |
169 Private method to convert a nodeid to a test path list. |
168 Private method to convert a nodeid to a test path list. |
170 </p> |
169 </p> |
|
170 |
171 <dl> |
171 <dl> |
172 |
172 |
173 <dt><i>nodeid</i> (str)</dt> |
173 <dt><i>nodeid</i> (str)</dt> |
174 <dd> |
174 <dd> |
175 nodeid to be converted |
175 nodeid to be converted |
188 </dd> |
188 </dd> |
189 </dl> |
189 </dl> |
190 <a NAME="PytestExecutor.__normalizeModuleName" ID="PytestExecutor.__normalizeModuleName"></a> |
190 <a NAME="PytestExecutor.__normalizeModuleName" ID="PytestExecutor.__normalizeModuleName"></a> |
191 <h4>PytestExecutor.__normalizeModuleName</h4> |
191 <h4>PytestExecutor.__normalizeModuleName</h4> |
192 <b>__normalizeModuleName</b>(<i>name</i>) |
192 <b>__normalizeModuleName</b>(<i>name</i>) |
193 |
|
194 <p> |
193 <p> |
195 Private method to convert a module name reported by pytest to Python |
194 Private method to convert a module name reported by pytest to Python |
196 conventions. |
195 conventions. |
197 </p> |
196 </p> |
198 <p> |
197 <p> |
199 This method strips the extensions '.pyw' and '.py' first and replaces |
198 This method strips the extensions '.pyw' and '.py' first and replaces |
200 '/' and '\' thereafter. |
199 '/' and '\' thereafter. |
201 </p> |
200 </p> |
|
201 |
202 <dl> |
202 <dl> |
203 |
203 |
204 <dt><i>name</i> (str)</dt> |
204 <dt><i>name</i> (str)</dt> |
205 <dd> |
205 <dd> |
206 module name reported by pytest |
206 module name reported by pytest |
219 </dd> |
219 </dd> |
220 </dl> |
220 </dl> |
221 <a NAME="PytestExecutor.__processData" ID="PytestExecutor.__processData"></a> |
221 <a NAME="PytestExecutor.__processData" ID="PytestExecutor.__processData"></a> |
222 <h4>PytestExecutor.__processData</h4> |
222 <h4>PytestExecutor.__processData</h4> |
223 <b>__processData</b>(<i>data</i>) |
223 <b>__processData</b>(<i>data</i>) |
224 |
|
225 <p> |
224 <p> |
226 Private slot to process the received data. |
225 Private slot to process the received data. |
227 </p> |
226 </p> |
|
227 |
228 <dl> |
228 <dl> |
229 |
229 |
230 <dt><i>data</i> (dict)</dt> |
230 <dt><i>data</i> (dict)</dt> |
231 <dd> |
231 <dd> |
232 data object received |
232 data object received |
233 </dd> |
233 </dd> |
234 </dl> |
234 </dl> |
235 <a NAME="PytestExecutor.createArguments" ID="PytestExecutor.createArguments"></a> |
235 <a NAME="PytestExecutor.createArguments" ID="PytestExecutor.createArguments"></a> |
236 <h4>PytestExecutor.createArguments</h4> |
236 <h4>PytestExecutor.createArguments</h4> |
237 <b>createArguments</b>(<i>config</i>) |
237 <b>createArguments</b>(<i>config</i>) |
238 |
|
239 <p> |
238 <p> |
240 Public method to create the arguments needed to start the test process. |
239 Public method to create the arguments needed to start the test process. |
241 </p> |
240 </p> |
|
241 |
242 <dl> |
242 <dl> |
243 |
243 |
244 <dt><i>config</i> (TestConfig)</dt> |
244 <dt><i>config</i> (TestConfig)</dt> |
245 <dd> |
245 <dd> |
246 configuration for the test execution |
246 configuration for the test execution |
259 </dd> |
259 </dd> |
260 </dl> |
260 </dl> |
261 <a NAME="PytestExecutor.discover" ID="PytestExecutor.discover"></a> |
261 <a NAME="PytestExecutor.discover" ID="PytestExecutor.discover"></a> |
262 <h4>PytestExecutor.discover</h4> |
262 <h4>PytestExecutor.discover</h4> |
263 <b>discover</b>(<i>config, pythonpath</i>) |
263 <b>discover</b>(<i>config, pythonpath</i>) |
264 |
|
265 <p> |
264 <p> |
266 Public method to start the test discovery process. |
265 Public method to start the test discovery process. |
267 </p> |
266 </p> |
|
267 |
268 <dl> |
268 <dl> |
269 |
269 |
270 <dt><i>config</i> (TestConfig)</dt> |
270 <dt><i>config</i> (TestConfig)</dt> |
271 <dd> |
271 <dd> |
272 configuration for the test discovery |
272 configuration for the test discovery |
277 </dd> |
277 </dd> |
278 </dl> |
278 </dl> |
279 <a NAME="PytestExecutor.finished" ID="PytestExecutor.finished"></a> |
279 <a NAME="PytestExecutor.finished" ID="PytestExecutor.finished"></a> |
280 <h4>PytestExecutor.finished</h4> |
280 <h4>PytestExecutor.finished</h4> |
281 <b>finished</b>(<i></i>) |
281 <b>finished</b>(<i></i>) |
282 |
|
283 <p> |
282 <p> |
284 Public method handling the unit test process been finished. |
283 Public method handling the unit test process been finished. |
285 </p> |
284 </p> |
286 <p> |
285 <p> |
287 This method should read the results (if necessary) and emit the signal |
286 This method should read the results (if necessary) and emit the signal |
288 testFinished. |
287 testFinished. |
289 </p> |
288 </p> |
|
289 |
290 <a NAME="PytestExecutor.getMarkers" ID="PytestExecutor.getMarkers"></a> |
290 <a NAME="PytestExecutor.getMarkers" ID="PytestExecutor.getMarkers"></a> |
291 <h4>PytestExecutor.getMarkers</h4> |
291 <h4>PytestExecutor.getMarkers</h4> |
292 <b>getMarkers</b>(<i>interpreter, workdir</i>) |
292 <b>getMarkers</b>(<i>interpreter, workdir</i>) |
293 |
|
294 <p> |
293 <p> |
295 Public method to get the list of defined markers. |
294 Public method to get the list of defined markers. |
296 </p> |
295 </p> |
|
296 |
297 <dl> |
297 <dl> |
298 |
298 |
299 <dt><i>interpreter</i> (str)</dt> |
299 <dt><i>interpreter</i> (str)</dt> |
300 <dd> |
300 <dd> |
301 interpreter to be used for the test |
301 interpreter to be used for the test |
319 </dd> |
319 </dd> |
320 </dl> |
320 </dl> |
321 <a NAME="PytestExecutor.getVersions" ID="PytestExecutor.getVersions"></a> |
321 <a NAME="PytestExecutor.getVersions" ID="PytestExecutor.getVersions"></a> |
322 <h4>PytestExecutor.getVersions</h4> |
322 <h4>PytestExecutor.getVersions</h4> |
323 <b>getVersions</b>(<i>interpreter</i>) |
323 <b>getVersions</b>(<i>interpreter</i>) |
324 |
|
325 <p> |
324 <p> |
326 Public method to get the test framework version and version information |
325 Public method to get the test framework version and version information |
327 of its installed plugins. |
326 of its installed plugins. |
328 </p> |
327 </p> |
|
328 |
329 <dl> |
329 <dl> |
330 |
330 |
331 <dt><i>interpreter</i> (str)</dt> |
331 <dt><i>interpreter</i> (str)</dt> |
332 <dd> |
332 <dd> |
333 interpreter to be used for the test |
333 interpreter to be used for the test |
347 </dd> |
347 </dd> |
348 </dl> |
348 </dl> |
349 <a NAME="PytestExecutor.hasCoverage" ID="PytestExecutor.hasCoverage"></a> |
349 <a NAME="PytestExecutor.hasCoverage" ID="PytestExecutor.hasCoverage"></a> |
350 <h4>PytestExecutor.hasCoverage</h4> |
350 <h4>PytestExecutor.hasCoverage</h4> |
351 <b>hasCoverage</b>(<i>interpreter</i>) |
351 <b>hasCoverage</b>(<i>interpreter</i>) |
352 |
|
353 <p> |
352 <p> |
354 Public method to check, if the collection of coverage data is available. |
353 Public method to check, if the collection of coverage data is available. |
355 </p> |
354 </p> |
|
355 |
356 <dl> |
356 <dl> |
357 |
357 |
358 <dt><i>interpreter</i> (str)</dt> |
358 <dt><i>interpreter</i> (str)</dt> |
359 <dd> |
359 <dd> |
360 interpreter to be used for the test |
360 interpreter to be used for the test |
373 </dd> |
373 </dd> |
374 </dl> |
374 </dl> |
375 <a NAME="PytestExecutor.start" ID="PytestExecutor.start"></a> |
375 <a NAME="PytestExecutor.start" ID="PytestExecutor.start"></a> |
376 <h4>PytestExecutor.start</h4> |
376 <h4>PytestExecutor.start</h4> |
377 <b>start</b>(<i>config, pythonpath</i>) |
377 <b>start</b>(<i>config, pythonpath</i>) |
378 |
|
379 <p> |
378 <p> |
380 Public method to start the testing process. |
379 Public method to start the testing process. |
381 </p> |
380 </p> |
|
381 |
382 <dl> |
382 <dl> |
383 |
383 |
384 <dt><i>config</i> (TestConfig)</dt> |
384 <dt><i>config</i> (TestConfig)</dt> |
385 <dd> |
385 <dd> |
386 configuration for the test execution |
386 configuration for the test execution |
391 </dd> |
391 </dd> |
392 </dl> |
392 </dl> |
393 <a NAME="PytestExecutor.startDebug" ID="PytestExecutor.startDebug"></a> |
393 <a NAME="PytestExecutor.startDebug" ID="PytestExecutor.startDebug"></a> |
394 <h4>PytestExecutor.startDebug</h4> |
394 <h4>PytestExecutor.startDebug</h4> |
395 <b>startDebug</b>(<i>config, pythonpath, debugger</i>) |
395 <b>startDebug</b>(<i>config, pythonpath, debugger</i>) |
396 |
|
397 <p> |
396 <p> |
398 Public method to start the test run with debugger support. |
397 Public method to start the test run with debugger support. |
399 </p> |
398 </p> |
|
399 |
400 <dl> |
400 <dl> |
401 |
401 |
402 <dt><i>config</i> (TestConfig)</dt> |
402 <dt><i>config</i> (TestConfig)</dt> |
403 <dd> |
403 <dd> |
404 configuration for the test execution |
404 configuration for the test execution |
413 </dd> |
413 </dd> |
414 </dl> |
414 </dl> |
415 <a NAME="PytestExecutor.supportsMarkers" ID="PytestExecutor.supportsMarkers"></a> |
415 <a NAME="PytestExecutor.supportsMarkers" ID="PytestExecutor.supportsMarkers"></a> |
416 <h4>PytestExecutor.supportsMarkers</h4> |
416 <h4>PytestExecutor.supportsMarkers</h4> |
417 <b>supportsMarkers</b>(<i>interpreter</i>) |
417 <b>supportsMarkers</b>(<i>interpreter</i>) |
418 |
|
419 <p> |
418 <p> |
420 Public method to indicate the support for test filtering using markers and/or |
419 Public method to indicate the support for test filtering using markers and/or |
421 marker expressions. |
420 marker expressions. |
422 </p> |
421 </p> |
|
422 |
423 <dl> |
423 <dl> |
424 |
424 |
425 <dt><i>interpreter</i> (str)</dt> |
425 <dt><i>interpreter</i> (str)</dt> |
426 <dd> |
426 <dd> |
427 interpreter to be used for the test |
427 interpreter to be used for the test |
440 </dd> |
440 </dd> |
441 </dl> |
441 </dl> |
442 <a NAME="PytestExecutor.supportsPatterns" ID="PytestExecutor.supportsPatterns"></a> |
442 <a NAME="PytestExecutor.supportsPatterns" ID="PytestExecutor.supportsPatterns"></a> |
443 <h4>PytestExecutor.supportsPatterns</h4> |
443 <h4>PytestExecutor.supportsPatterns</h4> |
444 <b>supportsPatterns</b>(<i>interpreter</i>) |
444 <b>supportsPatterns</b>(<i>interpreter</i>) |
445 |
|
446 <p> |
445 <p> |
447 Public method to indicate the support for test filtering using test name |
446 Public method to indicate the support for test filtering using test name |
448 patterns or a test name pattern expression. |
447 patterns or a test name pattern expression. |
449 </p> |
448 </p> |
|
449 |
450 <dl> |
450 <dl> |
451 |
451 |
452 <dt><i>interpreter</i> (str)</dt> |
452 <dt><i>interpreter</i> (str)</dt> |
453 <dd> |
453 <dd> |
454 interpreter to be used for the test |
454 interpreter to be used for the test |