diff --git a/news/2 Fixes/9553.md b/news/2 Fixes/9553.md new file mode 100644 index 000000000000..bffd265b0688 --- /dev/null +++ b/news/2 Fixes/9553.md @@ -0,0 +1,2 @@ +Partial fix for using the same directory as discovery when running tests. +(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 f4ed5637e050..c74ec5745970 100644 --- a/src/client/testing/testController/pytest/runner.ts +++ b/src/client/testing/testController/pytest/runner.ts @@ -89,7 +89,7 @@ export class PytestRunner implements ITestsRunner { // if user has provided `--rootdir` then use that, otherwise add `cwd` if (testArgs.filter((a) => a.startsWith('--rootdir')).length === 0) { // Make sure root dir is set so pytest can find the relative paths - testArgs.splice(0, 0, '--rootdir', options.workspaceFolder.fsPath); + testArgs.splice(0, 0, '--rootdir', options.cwd); } // Positional arguments control the tests to be run.