Skip to content

Change default current working directory in "request": "test" debug configuration #7204

Closed
@karrtikr

Description

@karrtikr

Currently, the default value of cwd is ${workspaceFolder}, so we assume the tests are being debugged from ${workspaceFolder}.

We should set cwd by default pointing it to directory set by test configuration instead. For example for unittest framework with configuration

    "python.testing.unittestArgs": [
        "-v",
        "-s",
        "./Tests",
        "-p",
        "*test_*.py"
    ],
    "python.testing.pytestEnabled": false,
    "python.testing.nosetestsEnabled": false,
    "python.testing.unittestEnabled": true

We should set "cwd" as "${workspaceFolder}/Tests" instead of "${workspaceFolder}. It helps avoid issues like #7176 (comment) where tests assume they are being run from "${workspaceFolder}/Tests" directory.

Originally posted by @karrtikr in #7176 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions