src/eric7/Testing/Interfaces/PytestExecutor.py

branch
eric7
changeset 10415
af9a6dac2611
parent 10405
df7e1694d0eb
child 10426
1150e67efb5a
equal deleted inserted replaced
10414:7c6bd2366602 10415:af9a6dac2611
242 else: 242 else:
243 self.__rootdir = "" 243 self.__rootdir = ""
244 244
245 super().start(config, pythonpath) 245 super().start(config, pythonpath)
246 246
247 def startDebug(self, config, pythonpath, debugger):
248 """
249 Public method to start the test run with debugger support.
250
251 @param config configuration for the test execution
252 @type TestConfig
253 @param pythonpath list of directories to be added to the Python path
254 @type list of str
255 @param debugger refference to the debugger interface
256 @type DebugUI
257 """
258 self.reader = EricJsonReader(name="Pytest Reader", parent=self)
259 self.reader.dataReceived.connect(self.__processData)
260
261 self.__config = config
262
263 if config.discoveryStart:
264 pythonpath.insert(0, os.path.abspath(config.discoveryStart))
265 elif config.testFilename:
266 pythonpath.insert(0, os.path.abspath(os.path.dirname(config.testFilename)))
267
268 if config.discover:
269 self.__rootdir = config.discoveryStart
270 elif config.testFilename:
271 self.__rootdir = os.path.dirname(config.testFilename)
272 else:
273 self.__rootdir = ""
274
275 super().startDebug(config, pythonpath, debugger)
276
247 def finished(self): 277 def finished(self):
248 """ 278 """
249 Public method handling the unit test process been finished. 279 Public method handling the unit test process been finished.
250 280
251 This method should read the results (if necessary) and emit the signal 281 This method should read the results (if necessary) and emit the signal
258 288
259 self.reader.close() 289 self.reader.close()
260 290
261 output = self.readAllOutput() 291 output = self.readAllOutput()
262 self.testFinished.emit([], output) 292 self.testFinished.emit([], output)
293
294 super().finished()
263 295
264 @pyqtSlot(object) 296 @pyqtSlot(object)
265 def __processData(self, data): 297 def __processData(self, data):
266 """ 298 """
267 Private slot to process the received data. 299 Private slot to process the received data.

eric ide

mercurial