Skip to content

Pytest args --rootdir is broken #16079

Description

Due to the usage of docker-compose my python app is in a subdirectory of the workspace therefore I want to do something like this:

  "python.testing.pytestArgs": [
    "--rootdir=/composeDir/app",
    "tests"
  ],
  "python.testing.cwd": /composeDir/app

but this does not work as expected. Since the --rootdir option is passed to pytest by default with the workspace location, vscode executes this

python /root/.vscode-server/extensions/ms-python.python-2021.4.765268190/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir /composeDir -s --cache-clear /composeDir/manager

In other words the custom rootdir option becomes the argument and "tests" is completely ignored.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-testingbugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from poster

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions