'Cannot debug pytest tests in Visual Studio 2022 -- symbols not loaded for my python code
I'm trying to debug pytest tests in Visual Studio 2022. I have the tests showing up in test explorer and when I run them they execute, however when I set a breakpoint and try to debug the test the breakpoints show the warning symbol and when I hover over it, it informs me that the breakpoint will not be hit because symbols are not loaded. The test does actually run, I just can't figure out how to get it to load whatever it needs to in order for me to debug. It's python so there's no module to inspect in the modules window to tell it to load symbols for and nothing is compiled so I don't know where symbols would even be. Is there something that needs to be configured in the pyproject (besides setting the test framework to pytest)? Debugging in my other python projects just worked out of the box. Is there a setting for loading symbols for your own python code? If so, does anyone know where or why it would be disabled for pytest tests while testing?
Solution 1:[1]
It turns out this was a bug in VS. Simply updating to the latest version resulted in everything magically working as expected.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | John Cuyle |