|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.Testing.Interfaces.PytestRunner</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.Testing.Interfaces.PytestRunner</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing the test runner script for the 'pytest' framework. |
|
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="#EricPlugin">EricPlugin</a></td> |
|
25 <td>Class implementing a pytest plugin which reports the data in a format suitable for the PytestExecutor.</td> |
|
26 </tr> |
|
27 <tr> |
|
28 <td><a href="#GetPluginVersionsPlugin">GetPluginVersionsPlugin</a></td> |
|
29 <td>Class implementing a pytest plugin to extract the version info of all installed plugins.</td> |
|
30 </tr> |
|
31 </table> |
|
32 <h3>Functions</h3> |
|
33 |
|
34 <table> |
|
35 |
|
36 <tr> |
|
37 <td><a href="#getVersions">getVersions</a></td> |
|
38 <td>Function to determine the framework version and versions of all available plugins.</td> |
|
39 </tr> |
|
40 </table> |
|
41 <hr /> |
|
42 <hr /> |
|
43 <a NAME="EricPlugin" ID="EricPlugin"></a> |
|
44 <h2>EricPlugin</h2> |
|
45 |
|
46 <p> |
|
47 Class implementing a pytest plugin which reports the data in a format |
|
48 suitable for the PytestExecutor. |
|
49 </p> |
|
50 <h3>Derived from</h3> |
|
51 None |
|
52 <h3>Class Attributes</h3> |
|
53 |
|
54 <table> |
|
55 <tr><td>None</td></tr> |
|
56 </table> |
|
57 <h3>Class Methods</h3> |
|
58 |
|
59 <table> |
|
60 <tr><td>None</td></tr> |
|
61 </table> |
|
62 <h3>Methods</h3> |
|
63 |
|
64 <table> |
|
65 |
|
66 <tr> |
|
67 <td><a href="#EricPlugin.__init__">EricPlugin</a></td> |
|
68 <td>Constructor</td> |
|
69 </tr> |
|
70 <tr> |
|
71 <td><a href="#EricPlugin.__initializeReportData">__initializeReportData</a></td> |
|
72 <td>Private method to initialize attributes for data collection.</td> |
|
73 </tr> |
|
74 <tr> |
|
75 <td><a href="#EricPlugin.pytest_collectreport">pytest_collectreport</a></td> |
|
76 <td>Public method called by pytest after the tests have been collected.</td> |
|
77 </tr> |
|
78 <tr> |
|
79 <td><a href="#EricPlugin.pytest_itemcollected">pytest_itemcollected</a></td> |
|
80 <td>Public malled by pytest after a test item has been collected.</td> |
|
81 </tr> |
|
82 <tr> |
|
83 <td><a href="#EricPlugin.pytest_report_header">pytest_report_header</a></td> |
|
84 <td>Public method called by pytest before any reporting.</td> |
|
85 </tr> |
|
86 <tr> |
|
87 <td><a href="#EricPlugin.pytest_runtest_logfinish">pytest_runtest_logfinish</a></td> |
|
88 <td>Public method called by pytest after a test has been completed.</td> |
|
89 </tr> |
|
90 <tr> |
|
91 <td><a href="#EricPlugin.pytest_runtest_logreport">pytest_runtest_logreport</a></td> |
|
92 <td>Public method called by pytest when a test phase (setup, call and teardown) has been completed.</td> |
|
93 </tr> |
|
94 <tr> |
|
95 <td><a href="#EricPlugin.pytest_runtest_logstart">pytest_runtest_logstart</a></td> |
|
96 <td>Public method called by pytest before running a test.</td> |
|
97 </tr> |
|
98 <tr> |
|
99 <td><a href="#EricPlugin.pytest_sessionfinish">pytest_sessionfinish</a></td> |
|
100 <td>Public method called by pytest after the whole test run finished.</td> |
|
101 </tr> |
|
102 <tr> |
|
103 <td><a href="#EricPlugin.pytest_sessionstart">pytest_sessionstart</a></td> |
|
104 <td>Public method called by pytest before performing collection and entering the run test loop.</td> |
|
105 </tr> |
|
106 </table> |
|
107 <h3>Static Methods</h3> |
|
108 |
|
109 <table> |
|
110 <tr><td>None</td></tr> |
|
111 </table> |
|
112 |
|
113 <a NAME="EricPlugin.__init__" ID="EricPlugin.__init__"></a> |
|
114 <h4>EricPlugin (Constructor)</h4> |
|
115 <b>EricPlugin</b>(<i>writer</i>) |
|
116 |
|
117 <p> |
|
118 Constructor |
|
119 </p> |
|
120 <dl> |
|
121 |
|
122 <dt><i>writer</i> (EricJsonWriter)</dt> |
|
123 <dd> |
|
124 reference to the object to write the results to |
|
125 </dd> |
|
126 </dl> |
|
127 <a NAME="EricPlugin.__initializeReportData" ID="EricPlugin.__initializeReportData"></a> |
|
128 <h4>EricPlugin.__initializeReportData</h4> |
|
129 <b>__initializeReportData</b>(<i></i>) |
|
130 |
|
131 <p> |
|
132 Private method to initialize attributes for data collection. |
|
133 </p> |
|
134 <a NAME="EricPlugin.pytest_collectreport" ID="EricPlugin.pytest_collectreport"></a> |
|
135 <h4>EricPlugin.pytest_collectreport</h4> |
|
136 <b>pytest_collectreport</b>(<i>report</i>) |
|
137 |
|
138 <p> |
|
139 Public method called by pytest after the tests have been collected. |
|
140 </p> |
|
141 <dl> |
|
142 |
|
143 <dt><i>report</i> (CollectReport)</dt> |
|
144 <dd> |
|
145 reference to the report object |
|
146 </dd> |
|
147 </dl> |
|
148 <a NAME="EricPlugin.pytest_itemcollected" ID="EricPlugin.pytest_itemcollected"></a> |
|
149 <h4>EricPlugin.pytest_itemcollected</h4> |
|
150 <b>pytest_itemcollected</b>(<i>item</i>) |
|
151 |
|
152 <p> |
|
153 Public malled by pytest after a test item has been collected. |
|
154 </p> |
|
155 <dl> |
|
156 |
|
157 <dt><i>item</i> (Item)</dt> |
|
158 <dd> |
|
159 reference to the collected test item |
|
160 </dd> |
|
161 </dl> |
|
162 <a NAME="EricPlugin.pytest_report_header" ID="EricPlugin.pytest_report_header"></a> |
|
163 <h4>EricPlugin.pytest_report_header</h4> |
|
164 <b>pytest_report_header</b>(<i>config, startdir</i>) |
|
165 |
|
166 <p> |
|
167 Public method called by pytest before any reporting. |
|
168 </p> |
|
169 <dl> |
|
170 |
|
171 <dt><i>config</i> (Config)</dt> |
|
172 <dd> |
|
173 reference to the configuration object |
|
174 </dd> |
|
175 <dt><i>startdir</i> (LocalPath)</dt> |
|
176 <dd> |
|
177 starting directory |
|
178 </dd> |
|
179 </dl> |
|
180 <a NAME="EricPlugin.pytest_runtest_logfinish" ID="EricPlugin.pytest_runtest_logfinish"></a> |
|
181 <h4>EricPlugin.pytest_runtest_logfinish</h4> |
|
182 <b>pytest_runtest_logfinish</b>(<i>nodeid, location</i>) |
|
183 |
|
184 <p> |
|
185 Public method called by pytest after a test has been completed. |
|
186 </p> |
|
187 <dl> |
|
188 |
|
189 <dt><i>nodeid</i> (str)</dt> |
|
190 <dd> |
|
191 node id of the test item |
|
192 </dd> |
|
193 <dt><i>location</i> (tuple of (str, int, str))</dt> |
|
194 <dd> |
|
195 tuple containing the file name, the line number and |
|
196 the test name |
|
197 </dd> |
|
198 </dl> |
|
199 <a NAME="EricPlugin.pytest_runtest_logreport" ID="EricPlugin.pytest_runtest_logreport"></a> |
|
200 <h4>EricPlugin.pytest_runtest_logreport</h4> |
|
201 <b>pytest_runtest_logreport</b>(<i>report</i>) |
|
202 |
|
203 <p> |
|
204 Public method called by pytest when a test phase (setup, call and |
|
205 teardown) has been completed. |
|
206 </p> |
|
207 <dl> |
|
208 |
|
209 <dt><i>report</i> (TestReport)</dt> |
|
210 <dd> |
|
211 reference to the test report object |
|
212 </dd> |
|
213 </dl> |
|
214 <a NAME="EricPlugin.pytest_runtest_logstart" ID="EricPlugin.pytest_runtest_logstart"></a> |
|
215 <h4>EricPlugin.pytest_runtest_logstart</h4> |
|
216 <b>pytest_runtest_logstart</b>(<i>nodeid, location</i>) |
|
217 |
|
218 <p> |
|
219 Public method called by pytest before running a test. |
|
220 </p> |
|
221 <dl> |
|
222 |
|
223 <dt><i>nodeid</i> (str)</dt> |
|
224 <dd> |
|
225 node id of the test item |
|
226 </dd> |
|
227 <dt><i>location</i> (tuple of (str, int, str))</dt> |
|
228 <dd> |
|
229 tuple containing the file name, the line number and |
|
230 the test name |
|
231 </dd> |
|
232 </dl> |
|
233 <a NAME="EricPlugin.pytest_sessionfinish" ID="EricPlugin.pytest_sessionfinish"></a> |
|
234 <h4>EricPlugin.pytest_sessionfinish</h4> |
|
235 <b>pytest_sessionfinish</b>(<i>session, exitstatus</i>) |
|
236 |
|
237 <p> |
|
238 Public method called by pytest after the whole test run finished. |
|
239 </p> |
|
240 <dl> |
|
241 |
|
242 <dt><i>session</i> (Session)</dt> |
|
243 <dd> |
|
244 reference to the session object |
|
245 </dd> |
|
246 <dt><i>exitstatus</i> (int or ExitCode)</dt> |
|
247 <dd> |
|
248 exit status |
|
249 </dd> |
|
250 </dl> |
|
251 <a NAME="EricPlugin.pytest_sessionstart" ID="EricPlugin.pytest_sessionstart"></a> |
|
252 <h4>EricPlugin.pytest_sessionstart</h4> |
|
253 <b>pytest_sessionstart</b>(<i>session</i>) |
|
254 |
|
255 <p> |
|
256 Public method called by pytest before performing collection and |
|
257 entering the run test loop. |
|
258 </p> |
|
259 <dl> |
|
260 |
|
261 <dt><i>session</i> (Session)</dt> |
|
262 <dd> |
|
263 reference to the session object |
|
264 </dd> |
|
265 </dl> |
|
266 <div align="right"><a href="#top">Up</a></div> |
|
267 <hr /> |
|
268 <hr /> |
|
269 <a NAME="GetPluginVersionsPlugin" ID="GetPluginVersionsPlugin"></a> |
|
270 <h2>GetPluginVersionsPlugin</h2> |
|
271 |
|
272 <p> |
|
273 Class implementing a pytest plugin to extract the version info of all |
|
274 installed plugins. |
|
275 </p> |
|
276 <h3>Derived from</h3> |
|
277 None |
|
278 <h3>Class Attributes</h3> |
|
279 |
|
280 <table> |
|
281 <tr><td>None</td></tr> |
|
282 </table> |
|
283 <h3>Class Methods</h3> |
|
284 |
|
285 <table> |
|
286 <tr><td>None</td></tr> |
|
287 </table> |
|
288 <h3>Methods</h3> |
|
289 |
|
290 <table> |
|
291 |
|
292 <tr> |
|
293 <td><a href="#GetPluginVersionsPlugin.__init__">GetPluginVersionsPlugin</a></td> |
|
294 <td>Constructor</td> |
|
295 </tr> |
|
296 <tr> |
|
297 <td><a href="#GetPluginVersionsPlugin.getVersions">getVersions</a></td> |
|
298 <td>Public method to get the assembled list of plugin versions.</td> |
|
299 </tr> |
|
300 <tr> |
|
301 <td><a href="#GetPluginVersionsPlugin.pytest_cmdline_main">pytest_cmdline_main</a></td> |
|
302 <td>Public method called for performing the main command line action.</td> |
|
303 </tr> |
|
304 </table> |
|
305 <h3>Static Methods</h3> |
|
306 |
|
307 <table> |
|
308 <tr><td>None</td></tr> |
|
309 </table> |
|
310 |
|
311 <a NAME="GetPluginVersionsPlugin.__init__" ID="GetPluginVersionsPlugin.__init__"></a> |
|
312 <h4>GetPluginVersionsPlugin (Constructor)</h4> |
|
313 <b>GetPluginVersionsPlugin</b>(<i></i>) |
|
314 |
|
315 <p> |
|
316 Constructor |
|
317 </p> |
|
318 <a NAME="GetPluginVersionsPlugin.getVersions" ID="GetPluginVersionsPlugin.getVersions"></a> |
|
319 <h4>GetPluginVersionsPlugin.getVersions</h4> |
|
320 <b>getVersions</b>(<i></i>) |
|
321 |
|
322 <p> |
|
323 Public method to get the assembled list of plugin versions. |
|
324 </p> |
|
325 <dl> |
|
326 <dt>Return:</dt> |
|
327 <dd> |
|
328 list of collected plugin versions |
|
329 </dd> |
|
330 </dl> |
|
331 <dl> |
|
332 <dt>Return Type:</dt> |
|
333 <dd> |
|
334 list of dict |
|
335 </dd> |
|
336 </dl> |
|
337 <a NAME="GetPluginVersionsPlugin.pytest_cmdline_main" ID="GetPluginVersionsPlugin.pytest_cmdline_main"></a> |
|
338 <h4>GetPluginVersionsPlugin.pytest_cmdline_main</h4> |
|
339 <b>pytest_cmdline_main</b>(<i>config</i>) |
|
340 |
|
341 <p> |
|
342 Public method called for performing the main command line action. |
|
343 </p> |
|
344 <dl> |
|
345 |
|
346 <dt><i>config</i> (Config)</dt> |
|
347 <dd> |
|
348 pytest config object |
|
349 </dd> |
|
350 </dl> |
|
351 <div align="right"><a href="#top">Up</a></div> |
|
352 <hr /> |
|
353 <hr /> |
|
354 <a NAME="getVersions" ID="getVersions"></a> |
|
355 <h2>getVersions</h2> |
|
356 <b>getVersions</b>(<i></i>) |
|
357 |
|
358 <p> |
|
359 Function to determine the framework version and versions of all available |
|
360 plugins. |
|
361 </p> |
|
362 <div align="right"><a href="#top">Up</a></div> |
|
363 <hr /> |
|
364 </body></html> |