From 2dd6c10b78caaa80b476b0f8f3c7c832207b5396 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Mon, 4 Oct 2021 19:17:03 -0700 Subject: [PATCH] Fix for pytest run all with pytest.ini --- news/2 Fixes/17546.md | 1 + src/client/testing/testController/pytest/runner.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 news/2 Fixes/17546.md diff --git a/news/2 Fixes/17546.md b/news/2 Fixes/17546.md new file mode 100644 index 000000000000..353af438fdca --- /dev/null +++ b/news/2 Fixes/17546.md @@ -0,0 +1 @@ +Fix for `pytest` run all tests when using `pytest.ini`. diff --git a/src/client/testing/testController/pytest/runner.ts b/src/client/testing/testController/pytest/runner.ts index bd53f82baedb..f4ed5637e050 100644 --- a/src/client/testing/testController/pytest/runner.ts +++ b/src/client/testing/testController/pytest/runner.ts @@ -97,7 +97,9 @@ export class PytestRunner implements ITestsRunner { if (!rawData) { throw new Error(`Trying to run unknown node: ${testNode.id}`); } - testArgs.push(rawData.rawId); + if (testNode.id !== options.workspaceFolder.fsPath) { + testArgs.push(rawData.rawId); + } runInstance.appendOutput(`Running test with arguments: ${testArgs.join(' ')}\r\n`); runInstance.appendOutput(`Current working directory: ${options.cwd}\r\n`);