[python] PY-87784, PY-87782: pytest output is not formatted correctly

Fix pytest test results merging into a single line in the Debug console.
Also fix PY-87784 NPE when trying to view the value of a variable 
after the code has finished running in the console.

Merge-request: IJ-MR-192615
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

(cherry picked from commit 03dbea8699aadd447456b23fdefd55b950038bba)

IJ-MR-192615

GitOrigin-RevId: 6d584e764f9369167c43d179777aa4966081d951
This commit is contained in:
Egor Eliseev
2026-03-03 08:30:51 +00:00
committed by intellij-monorepo-bot
parent 84035b1ad5
commit 48cd8061c4
2 changed files with 7 additions and 1 deletions
@@ -3,4 +3,5 @@ pydev.show.value=Show Value
pydev.view.as=...View as {0}
pydev.view.as.image=...View as Image
pydev.value.protected.attributes.group.name=Protected Attributes
pydev.error.message.failed.to.find.free.socket.port=Failed to find a free socket port
pydev.error.message.failed.to.find.free.socket.port=Failed to find a free socket port
pydev.session.finished=Session has ended
@@ -3,6 +3,7 @@ package com.jetbrains.python.debugger;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.xdebugger.frame.XFullValueEvaluator;
import com.jetbrains.python.PydevBundle;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
@@ -45,6 +46,10 @@ public class PyFullValueEvaluator extends XFullValueEvaluator {
ApplicationManager.getApplication().executeOnPooledThread(() -> {
try {
final PyDebugValue value = myDebugProcess.evaluate(expression, false, doTrunc);
if (value == null) {
callback.evaluated(PydevBundle.message("pydev.session.finished"));
return;
}
if (value.getValue() == null) {
throw new PyDebuggerException("Failed to Load Value");
}