Skip to main content
 首页 » 编程设计

python之PyCharm/ python 。代码不运行。立即收到 "Getting Process finished with exit code 0"

2025年02月15日9myhome

我最近更换了我的工作站并在 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 运行/调试配置来运行。

来自 How do I configure PyCharm to run py.test tests?

请转到文件 |设置 |工具 | Python Integrated Tools 并将默认测试运行器更改为 py.test。然后您将获得 py.test 选项来创建测试而不是单元测试。