Closed paulstretenowich closed 8 months ago
I don't think debugpy
has anything special for pytest.
Pretty sure you would have to use a script to run the test case with pytest and then debug that script.
That seems to be what the vscode-python
extension does when using their test runner ui https://github.com/microsoft/vscode-python/blob/main/pythonFiles/testlauncher.py
Thanks for your answer!
This was my guess too. I have to use something external of the debugger to trigger the pytest
. I was wondering if I could configure the debugger to use either an external script or pytest
itself for debugging and stop at breakpoints. So far using a snippet I found online is the only way for creating breakpoints and stopping a pytest
call but it's not in Sublime unfortunately.
You should be able to just make a script like the vscode one I linked which calls pytest. You would then debug that script with whatever arguments you want sent to pytest to run the test you want.
Here is the list of configuration options you can use https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings
Thanks for your help, I'll see if I can have something working and share it here for others,
Hi, I just started using your nice plugin and I try to setup a call to pytest because if I run the debugger on a test.py in which there is just a function defined it doesn't stop at a breakpoint as the function should be called by
pytest
. I can share anything you might find relevant to help. Thanks in advance for the help!