Tox: How to debug pytest plugin in PyCharm?

Created on 21 Mar 2017  路  3Comments  路  Source: tox-dev/tox

So tests invoking the tox command via _pytestplugin.py cannot be debugged because the debugger does not attach to the subprocess inside PyCharm. Is this the intended workflow?

documentation type

Most helpful comment

Both choices are valid, I think this is something we should cover in our developer documentation.

All 3 comments

I don't think there is an established workflow involving PyCharm. I also use PyCharm, but have not yet done any plugin debugging. Have you alreadfy tried to attach to the process explicitly as workaround?

When you run tox, it installs the project in its sub virtualenv, and then the files executed are not the one you edit/debug in PyCharm. To debug tests I usually create a configuration in PyCharm that just run the command to test (like pytest with arguments), not tox. This way the current files are executed and debugged.

Both choices are valid, I think this is something we should cover in our developer documentation.

Was this page helpful?
0 / 5 - 0 ratings