如何使用Docker Python解释器在PyCharm中的Debug中执行我的测试?

时间:2016-10-05 13:28:00

标签: python debugging docker pycharm remote-debugging

我将PyCharm Python Interpreter配置为远程Docker Python解释器:

enter image description here

使用此配置运行测试没有任何问题。

但是当我尝试在__construct()中运行它们时,执行会冻结到此AuditedSaveImplementation状态:

enter image description here

所以我的问题是:

  • 我做得不好?
  • 如何使用Docker Python Interpreter在PyCharm中的Debug中执行测试?

1 个答案:

答案 0 :(得分:0)

此问题是由pydevd来源PyCharm来源10.0.0.2硬编码的主机IP地址引起的。

因此,如果您不使用VirtualBox来管理和运行docker-machine,则无法在调试中轻松启动测试。

PyCharm 2016.3 docker interpreterPyCharm 2016.3.1 docker-compose interpreter修补。

等待此版本,存在一种解决方法here, on JetBrain website