From 32ea534f7144fb1c9bd7502e91451e69f2fcd218 Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Thu, 2 Nov 2023 09:43:25 -0700 Subject: [PATCH] remove new line chars from error text messages in testing rewrite (#22402) fixes https://github.com/microsoft/vscode-python/issues/21512 where 2 extra new lines were seen at the end of an error message popup. Removing these will restrict stop this from occurring. --- src/client/testing/testController/common/resultResolver.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/testing/testController/common/resultResolver.ts b/src/client/testing/testController/common/resultResolver.ts index 3bf7d6baf34b..15efc7aa4bb8 100644 --- a/src/client/testing/testController/common/resultResolver.ts +++ b/src/client/testing/testController/common/resultResolver.ts @@ -153,7 +153,7 @@ export class PythonResultResolver implements ITestResultResolver { }).join('\r\n'); const text = `${testItem.test} failed with error: ${ testItem.message ?? testItem.outcome - }\r\n${traceback}\r\n`; + }\r\n${traceback}`; const message = new TestMessage(text); const grabVSid = this.runIdToVSid.get(keyTemp); @@ -173,7 +173,7 @@ export class PythonResultResolver implements ITestResultResolver { removeEmptyEntries: true, }).join('\r\n'); - const text = `${testItem.test} failed: ${testItem.message ?? testItem.outcome}\r\n${traceback}\r\n`; + const text = `${testItem.test} failed: ${testItem.message ?? testItem.outcome}\r\n${traceback}`; const message = new TestMessage(text); // note that keyTemp is a runId for unittest library... @@ -235,7 +235,7 @@ export class PythonResultResolver implements ITestResultResolver { const traceback = data.traceback ?? ''; const text = `${data.subtest} failed: ${ testItem.message ?? testItem.outcome - }\r\n${traceback}\r\n`; + }\r\n${traceback}`; parentTestItem.children.add(subTestItem); runInstance.started(subTestItem); const message = new TestMessage(text);