diff --git a/news/2 Fixes/17546.md b/news/2 Fixes/17546.md new file mode 100644 index 000000000000..877e68aed6de --- /dev/null +++ b/news/2 Fixes/17546.md @@ -0,0 +1,2 @@ +Fix for `pytest` run all tests when using `pytest.ini` and `cwd`. +(thanks [Brian Rutledge](https://github.com/bhrutledge)) diff --git a/src/client/testing/testController/pytest/runner.ts b/src/client/testing/testController/pytest/runner.ts index c74ec5745970..96f51cfabaf6 100644 --- a/src/client/testing/testController/pytest/runner.ts +++ b/src/client/testing/testController/pytest/runner.ts @@ -97,7 +97,7 @@ export class PytestRunner implements ITestsRunner { if (!rawData) { throw new Error(`Trying to run unknown node: ${testNode.id}`); } - if (testNode.id !== options.workspaceFolder.fsPath) { + if (testNode.id !== options.cwd) { testArgs.push(rawData.rawId); }