--- a/eric7/Unittest/Interfaces/PytestExecutor.py Mon May 16 17:22:43 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2022 Detlev Offenbach <detlev@die-offenbachs.de> -# - -""" -Module implementing the executor for the 'pytest' framework. -""" - -import contextlib -import json -import os - -from PyQt6.QtCore import QProcess - -from .UTExecutorBase import UTExecutorBase - - -# TODO: implement 'pytest' support in PytestExecutor -class PytestExecutor(UTExecutorBase): - """ - Class implementing the executor for the 'pytest' framework. - """ - module = "pytest" - name = "pytest" - - runner = os.path.join(os.path.dirname(__file__), "PytestRunner.py") - - def getVersions(self, interpreter): - """ - Public method to get the test framework version and version information - of its installed plugins. - - @param interpreter interpreter to be used for the test - @type str - @return dictionary containing the framework name and version and the - list of available plugins with name and version each - @rtype dict - """ - proc = QProcess() - proc.start(interpreter, [PytestExecutor.runner, "versions"]) - if proc.waitForFinished(3000): - exitCode = proc.exitCode() - if exitCode == 0: - outputLines = self.readAllOutput(proc).splitlines() - for line in outputLines: - if line.startswith("{") and line.endswith("}"): - with contextlib.suppress(json.JSONDecodeError): - return json.loads(line) - - return {}