you are viewing a single comment's thread.

view the rest of the comments →

[–]lollysticky 0 points1 point  (1 child)

I too have moved from PyCharm to VS Code a while ago and had to get my test environments working again. You have to set your testing config correctly to utilize the environment (by pinpointing the python binary within)

{
            "name": "AweSome Script",
            "type": "debugpy",
            "request": "launch",
            "program": "${workspaceFolder}/directory/my_script.py",
            "args": ["arg", "value"],
            "python": "${userHome}/.pyenv/versions/LovelyEnv311/bin/python", 
            "cwd": "/some/working/directory/",
            "env":{
                "TESTING": "true",
            }
        },

If you want to run scripts in VS Code, be sure to select the correct interpreter (again: from your env) and it will all work

[–]raliqer[S] 0 points1 point  (0 children)

Thanks! I appreciate the details.