174 "filename": item.location[0], |
174 "filename": item.location[0], |
175 "linenumber": item.location[1], |
175 "linenumber": item.location[1], |
176 } |
176 } |
177 ) |
177 ) |
178 |
178 |
179 def pytest_runtest_logstart(self, nodeid, location): # noqa: U100 |
179 def pytest_runtest_logstart(self, nodeid, location): # noqa: U-100 |
180 """ |
180 """ |
181 Public method called by pytest before running a test. |
181 Public method called by pytest before running a test. |
182 |
182 |
183 @param nodeid node id of the test item |
183 @param nodeid node id of the test item |
184 @type str |
184 @type str |
266 data["message"] = messageLines[0] |
266 data["message"] = messageLines[0] |
267 data["report"] = "\n".join(self.__report) |
267 data["report"] = "\n".join(self.__report) |
268 |
268 |
269 self.__writer.write(data) |
269 self.__writer.write(data) |
270 |
270 |
271 def pytest_sessionstart(self, session): # noqa: U100 |
271 def pytest_sessionstart(self, session): # noqa: U-100 |
272 """ |
272 """ |
273 Public method called by pytest before performing collection and |
273 Public method called by pytest before performing collection and |
274 entering the run test loop. |
274 entering the run test loop. |
275 |
275 |
276 @param session reference to the session object (unused) |
276 @param session reference to the session object (unused) |
277 @type Session |
277 @type Session |
278 """ |
278 """ |
279 self.__totalStartTime = time.monotonic_ns() |
279 self.__totalStartTime = time.monotonic_ns() |
280 self.__testsRun = 0 |
280 self.__testsRun = 0 |
281 |
281 |
282 def pytest_sessionfinish(self, session, exitstatus): # noqa: U100 |
282 def pytest_sessionfinish(self, session, exitstatus): # noqa: U-100 |
283 """ |
283 """ |
284 Public method called by pytest after the whole test run finished. |
284 Public method called by pytest after the whole test run finished. |
285 |
285 |
286 @param session reference to the session object (unused) |
286 @param session reference to the session object (unused) |
287 @type Session |
287 @type Session |
329 def getMarkers(): |
329 def getMarkers(): |
330 """ |
330 """ |
331 Function to determine the defined markers and their descriptions. |
331 Function to determine the defined markers and their descriptions. |
332 """ |
332 """ |
333 try: |
333 try: |
334 import pytest # __IGNORE_WARNING_I10__ |
334 import pytest # __IGNORE_WARNING_I-10__ |
335 |
335 |
336 # --capture=sys needed on Windows to avoid |
336 # --capture=sys needed on Windows to avoid |
337 # ValueError: saved filedescriptor not valid anymore |
337 # ValueError: saved filedescriptor not valid anymore |
338 plugin = GetMarkersPlugin() |
338 plugin = GetMarkersPlugin() |
339 pytest.main(["--markers", "--capture=sys"], plugins=[plugin]) |
339 pytest.main(["--markers", "--capture=sys"], plugins=[plugin]) |