So, the solution here is setting "justM圜ode": "true" in your "request": "test" launch please try to set the justM圜ode in your "request": "test" launch config too. This happens because: site.getsitepackages() is returning c:\dev\ingest_oba. py file and try to debug with the following launch.json configuration: , It also fails the breakpoing if I put a bookmark in a simple. There are also other bookmarks inside my tests. Then the test is executed, but my bookmarked command print(123) at top level of the test module does not stop. /Scripts/pytest.exe download_test.pyĪnd from the debug tab I try to connect using this configuration in my launch.json: "configurations": [ Then launch VS Code, and select the Run icon from the. If from my activated workspace in a _ bash shell_ I run the following command: Attaching the Debugger to a Running App From the top toolbar select Window > Extensions. = 1 passed in 0.13s =Īnd nothing happens. generated xml file: C:\Users\ppppp\AppData\Local\Temp\tmp-15396J3k1TtjEH4i3.xml. Rootdir: c:\dev\ingest_oba, configfile: obabr\pytest.ini Here is the output of the debug console: = test session starts = When I click in the debug icon of my breakpointed test, the VS Code status bar becomes orange, then becomes: I can successfully run my tests from the VS Code test tab: This directory also has the file pytest.ini which content is: My workspace is structured this way root/obabr/ obabr is the name of the package I'm developing.
#Debugging python in visual studio code install#
I installed my module as editable running from inside the venv, in the root folder: pip install -e obabr
![debugging python in visual studio code debugging python in visual studio code](https://code.visualstudio.com/assets/docs/python/debugging/debug-start-button.png)
![debugging python in visual studio code debugging python in visual studio code](https://miro.medium.com/max/2732/1*zxMNcMeKho9dMpy1DbHMgA.png)
I'm working inside a venv and its python exe is set as my VS Code python interpreter. I want to be able to click in the highlighted icon below of one of my pytest unit tests:Īnd to have the debugger stop at this breakpoint:Īnd be able to step through it. VS Code does not stops at my breakpoints, nor from running from test tabs, nor trying to stepping into a file, nor running python -m debugpy and trying to attach to it.
#Debugging python in visual studio code 64 bits#