Search code examples
pythondebuggingdockerpycharmremote-debugging

How can I execute my tests in Debug in PyCharm using a Docker Python Interpreter?


I configured PyCharm Python Interpreter as a remote Docker Python Interpreter:

enter image description here

I do not have any problem to run my tests using this configuration.

But when I try to run them in Debug, execution freeze to this waiting for connection... status:

enter image description here

So my questions are:

  • What am I doing bad?
  • How can I execute my tests in Debug in PyCharm using a Docker Python Interpreter ?

Solution

  • This problem is due to pydevd hardcoded host ip address in PyCharm sources (10.0.0.2).

    So if you do not use VirtualBox to manage and run your docker-machine, you will not be able to easily launch your tests in debug.

    It should be patched in PyCharm 2016.3 for docker interpreter and in PyCharm 2016.3.1 for docker-compose interpreter.

    Awaiting this release, a workaround exist here, on JetBrain website.