Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ export class PytestTestDiscoveryAdapter implements ITestDiscoveryAdapter {
traceWarn("Symlink found, adding '--rootdir' to pytestArgs only if it doesn't already exist. cwd: ", cwd);
pytestArgs = addValueIfKeyNotExist(pytestArgs, '--rootdir', cwd);
}
// if user has provided `--rootdir` then use that, otherwise add `cwd`
// root dir is required so pytest can find the relative paths and for symlinks
addValueIfKeyNotExist(pytestArgs, '--rootdir', cwd);

// get and edit env vars
const mutableEnv = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,17 @@ suite('pytest test discovery adapter', () => {

// verification

const expectedArgs = ['-m', 'pytest', '-p', 'vscode_pytest', '--collect-only', '.', 'abc', 'xyz'];
const expectedArgs = [
'-m',
'pytest',
'-p',
'vscode_pytest',
'--collect-only',
'.',
'abc',
'xyz',
`--rootdir=${expectedPathNew}`,
];
execService.verify(
(x) =>
x.execObservable(
Expand Down
Loading