Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pytest on Python Tools for visual studio

Can debug python tests which are using pytest library on visual studio 2010 ? I added the -m pytest on the Interpreter arguments but the breakpoints are not hit, I can only run the test script without debugging it.

like image 483
caesar Avatar asked Dec 02 '13 10:12

caesar


2 Answers

It would be great if you can be more specific. When I used pytools I found it very useful and found great help at http://pytools.codeplex.com. You can check http://pytools.codeplex.com/discussions.

Also check Can I debug with python debugger when using py.test somehow? or Python Unit Testing: Automatically Running the Debugger when a test fails for help as they have asked something similar.

like image 72
fscore Avatar answered Oct 29 '22 11:10

fscore


Pytest recommends creating a standalone startup script.

if __name__ == '__main__':
    import pytest
    pytest.main()

This is what I do and PTVS debugging works for me.

like image 41
Aron Curzon Avatar answered Oct 29 '22 10:10

Aron Curzon