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`);