diff -r 2b9bd8f97576 -r 4ac66b6c33a4 eric7/Debugger/DebuggerInterfacePython.py --- a/eric7/Debugger/DebuggerInterfacePython.py Mon May 02 15:53:05 2022 +0200 +++ b/eric7/Debugger/DebuggerInterfacePython.py Wed Jun 01 13:48:49 2022 +0200 @@ -366,10 +366,6 @@ # start debugger with project specific settings debugClient = project.getDebugProperty("DEBUGCLIENT") - if not venvName: - venvName = project.getDebugProperty("VIRTUALENV") - if not venvName and project.getProjectLanguage() == "Python3": - venvName = Preferences.getDebugger("Python3VirtualEnv") redirect = ( str(configOverride["redirect"]) @@ -384,14 +380,8 @@ else '' ) - venvManager = ericApp().getObject("VirtualEnvManager") - interpreter = venvManager.getVirtualenvInterpreter(venvName) - execPath = venvManager.getVirtualenvExecPath(venvName) - if ( - interpreter == "" and - project.getProjectLanguage().startswith("Python") - ): - interpreter = Globals.getPythonExecutable() + execPath = project.getProjectExecPath() + interpreter = project.getProjectInterpreter() if interpreter == "": EricMessageBox.critical( None, @@ -1215,104 +1205,6 @@ "text": text, }, debuggerId) - def remoteUTDiscover(self, syspath, workdir, discoveryStart): - """ - Public method to perform a test case discovery. - - @param syspath list of directories to be added to sys.path on the - remote side - @type list of str - @param workdir path name of the working directory - @type str - @param discoveryStart directory to start auto-discovery at - @type str - """ - self.__sendJsonCommand("RequestUTDiscover", { - "syspath": [] if syspath is None else syspath, - "workdir": workdir, - "discoverystart": discoveryStart, - }) - - def remoteUTPrepare(self, fn, tn, tfn, failed, cov, covname, coverase, - syspath, workdir, discover, discoveryStart, testCases, - debug): - """ - Public method to prepare a new unittest run. - - @param fn name of file to load - @type str - @param tn name of test to load - @type str - @param tfn test function name to load tests from - @type str - @param failed list of failed test, if only failed test should be run - @type list of str - @param cov flag indicating collection of coverage data is requested - @type bool - @param covname name of file to be used to assemble the coverage caches - filename - @type str - @param coverase flag indicating erasure of coverage data is requested - @type bool - @param syspath list of directories to be added to sys.path on the - remote side - @type list of str - @param workdir path name of the working directory - @type str - @param discover flag indicating to discover the tests automatically - @type bool - @param discoveryStart directory to start auto-discovery at - @type str - @param testCases list of test cases to be loaded - @type list of str - @param debug flag indicating to run unittest with debugging - @type bool - """ - if fn: - self.__scriptName = os.path.abspath(fn) - - fn = self.translate(os.path.abspath(fn), False) - else: - self.__scriptName = "unittest discover" - - self.__sendJsonCommand("RequestUTPrepare", { - "filename": fn, - "testname": tn, - "testfunctionname": tfn, - "failed": failed, - "coverage": cov, - "coveragefile": covname, - "coverageerase": coverase, - "syspath": [] if syspath is None else syspath, - "workdir": workdir, - "discover": discover, - "discoverystart": discoveryStart, - "testcases": [] if testCases is None else testCases, - "debug": debug, - }) - - def remoteUTRun(self, debug, failfast): - """ - Public method to start a unittest run. - - @param debug flag indicating to run unittest with debugging - @type bool - @param failfast flag indicating to stop at the first error - @type bool - """ - if debug: - self.__autoContinue = True - self.__sendJsonCommand("RequestUTRun", { - "debug": debug, - "failfast": failfast, - }) - - def remoteUTStop(self): - """ - Public method to stop a unittest run. - """ - self.__sendJsonCommand("RequestUTStop", {}) - def __parseClientLine(self, sock): """ Private method to handle data from the client. @@ -1519,49 +1411,6 @@ elif method == "ResponseCompletion": self.debugServer.signalClientCompletionList( params["completions"], params["text"], params["debuggerId"]) - - ################################################################### - ## Unit test related stuff is not done with multi processing - ################################################################### - - elif method == "ResponseUTDiscover": - self.debugServer.clientUtDiscovered( - params["testCasesList"], params["exception"], - params["message"]) - - elif method == "ResponseUTPrepared": - self.debugServer.clientUtPrepared( - params["count"], params["exception"], params["message"]) - - elif method == "ResponseUTFinished": - self.debugServer.clientUtFinished(params["status"]) - - elif method == "ResponseUTStartTest": - self.debugServer.clientUtStartTest( - params["testname"], params["description"]) - - elif method == "ResponseUTStopTest": - self.debugServer.clientUtStopTest() - - elif method == "ResponseUTTestFailed": - self.debugServer.clientUtTestFailed( - params["testname"], params["traceback"], params["id"]) - - elif method == "ResponseUTTestErrored": - self.debugServer.clientUtTestErrored( - params["testname"], params["traceback"], params["id"]) - - elif method == "ResponseUTTestSkipped": - self.debugServer.clientUtTestSkipped( - params["testname"], params["reason"], params["id"]) - - elif method == "ResponseUTTestFailedExpected": - self.debugServer.clientUtTestFailedExpected( - params["testname"], params["traceback"], params["id"]) - - elif method == "ResponseUTTestSucceededUnexpected": - self.debugServer.clientUtTestSucceededUnexpected( - params["testname"], params["id"]) def __sendJsonCommand(self, command, params, debuggerId="", sock=None): """