简体   繁体   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"

I recently switched my workstation and reinstalled all my environment on Fedora 25. When attempting to run any part of my project (I run PyTest tests) I always end up getting "Process finished with exit code 0" message in debug.我最近切换了我的工作站并在 Fedora 25 上重新安装了我的所有环境。当尝试运行我的项目的任何部分(我运行 PyTest 测试)时,我总是在调试中得到“进程完成,退出代码 0”消息。

Here's the full debug message:这是完整的调试消息:

    /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'])

The project I am trying to run is actually open sourced and is here for reference: https://github.com/ManageIQ/integration_tests我试图运行的项目实际上是开源的,在这里供参考: https ://github.com/ManageIQ/integration_tests

Ok, so the problem was that the I tried to run it as Python Run/Debug configuration instead of Py.test run/debug configuration.好的,所以问题是我试图将它作为 Python 运行/调试配置而不是 Py.test 运行/调试配置运行。

From How do I configure PyCharm to run py.test tests?如何配置 PyCharm 运行 py.test 测试?

Please go to File |请转到文件 | Settings |设置 | Tools |工具 | Python Integrated Tools and change the default test runner to py.test. Python 集成工具并将默认测试运行程序更改为 py.test。 Then you'll get the py.test option to create tests instead of the unittest one.然后你会得到 py.test 选项来创建测试而不是 unittest 一个。

In my case, along with the rest of great suggestions, somehow content root was not defined.就我而言,除了其他很好的建议外,还没有定义内容根。 Solution: File|Settings|Project Structure -> Add Content Root (Here you select your project folder)解决方案:File|Settings|Project Structure -> Add Content Root(这里选择你的项目文件夹)

*It took me a looong time for this, hope that this will help somebody :) *我花了很长时间,希望这会帮助别人:)

更改设置后不起作用。

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

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