kondratyev-nv / vscode-python-test-adapter

Python Test Adapter for the VS Code Test Explorer
https://marketplace.visualstudio.com/items?itemName=LittleFoxTeam.vscode-python-test-adapter
MIT License
117 stars 27 forks source link

Could not load unit test config from launch.json as it is missing a field #297

Closed naturedamends closed 1 year ago

naturedamends commented 1 year ago

Working fine for normal runs. But this error happens when running with debug.

Linux, ubuntu

When closing the notification prompt, the tests start to run.

{
    "python.testing.pytestArgs": [
        "tests"
    ],
    "python.testing.unittestEnabled": false,
    "python.testing.pytestEnabled": true,
    "python.testing.promptToConfigure": true
}

with the following, it dons't seem to work. Its not loading the env file.

    {
      "name": "Debug test",
      "type": "python",
      "request": "launch",
      "justMyCode": false,
      "stopOnEntry": true,
      "envFile": "${workspaceFolder}/.env.test",
      "purpose": ["debug-test"]
    }

I also seem to be unable to get a launch.json config that overrides the default testing launcher without debug.

The docs are a little outof date since, type test is not a valid input anymore.

Even though i'm using pytest, it using the unittest config

image
naturedamends commented 1 year ago

It was the "version" key from launch.json that i was missing.