繁体   English   中英

PyCharm/Python。 代码不运行。 立即收到“Getting Process finished with exit code 0”

[英]PyCharm/Python. Code doesn't run. Immediately receiving "Getting Process finished with exit code 0"

我最近切换了我的工作站并在 Fedora 25 上重新安装了我的所有环境。当尝试运行我的项目的任何部分(我运行 PyTest 测试)时,我总是在调试中得到“进程完成,退出代码 0”消息。

这是完整的调试消息:

    /usr/bin/python2.7 /usr/share/java/pycharm-community/helpers/pydev/pydevd.py --multiproc --qt-support --client 127.0.0.1 --port 46537 --file /home/pavel/Documents/integration_tests/cfme/tests/containers/test_containers_default_project_replicators.py
warning: Debugger speedups using cython not found. Run '"/usr/bin/python2.7" "/usr/share/java/pycharm-community/helpers/pydev/setup_cython.py" build_ext --inplace' to build.
pydev debugger: process 10166 is connecting

Connected to pydev debugger (build 163.10154.50)
/home/pavel/Documents/integration_tests/utils/log.py:222: UserWarning: clearing configuration is bad
  del(conf['env'])

我试图运行的项目实际上是开源的,在这里供参考: https ://github.com/ManageIQ/integration_tests

好的,所以问题是我试图将它作为 Python 运行/调试配置而不是 Py.test 运行/调试配置运行。

如何配置 PyCharm 运行 py.test 测试?

请转到文件 | 设置 | 工具 | Python 集成工具并将默认测试运行程序更改为 py.test。 然后你会得到 py.test 选项来创建测试而不是 unittest 一个。

就我而言,除了其他很好的建议外,还没有定义内容根。 解决方案:File|Settings|Project Structure -> Add Content Root(这里选择你的项目文件夹)

*我花了很长时间,希望这会帮助别人:)

更改设置后不起作用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM