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

vscode python remote testing and debugging with breakpoints not working #306

Open lorenzozanisi opened 7 months ago

lorenzozanisi commented 7 months ago

I cannot run tests on my remote machine using the test explorer in vscode. It works fine locally. I can run tests from the command line no problem.

I set up the testing by clicking on the little flask in the sidebar, and selected Python and pytest. At this point the test explorer is supposed to discover which tests exist. As you can see in the screenshot, the test explorer finds the tests folder, but this doesn't contain anything. Also I when I run the tests something does happen (see the test results). I know some tests should fail but I don't get any feedback in the console, which tells me something strange is going on. This also means that I can't get to the break points and debug the tests, which is why I the main reason why use the test explorer.

image

I'm using IntelliSense 2023.20.0 on a Linux remote machine. My settings.json is:

{
    "python.testing.pytestArgs": [
        "tests"
    ],
    "python.testing.pytestPath": "~/anaconda3/envs/py39/bin/pytest",
    "python.testing.unittestEnabled": false,
    "python.testing.pytestEnabled": true,
    "python.defaultInterpreterPath": "~/anaconda3/envs/py39/bin/python"
}

and my launch.json is

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": true
        }

    ]
}

Any help would be appreciated!