Python pycharm中的py.test出错

Python pycharm中的py.test出错,python,pycharm,pytest,Python,Pycharm,Pytest,当我在我的系统上运行pytest时,它给出了一个错误:0.01秒内没有运行任何测试。有人能告诉我这是因为我的代码错误还是其他原因 输出为: ============================= test session starts ============================== platform darwin -- Python 2.7.11, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 rootdir: /Users/Desktop, in

当我在我的系统上运行pytest时,它给出了一个错误:0.01秒内没有运行任何测试。有人能告诉我这是因为我的代码错误还是其他原因

输出为:

============================= test session starts ==============================
platform darwin -- Python 2.7.11, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
rootdir: /Users/Desktop, inifile: 
collected 0 items

========================= no tests ran in 0.01 seconds =========================

进程结束,退出代码为0,我也遇到了同样的问题,修复方法是更改rootdir

转到
设置->tools->externaltools
,将pyTest的参数设置为
“$FileName$”
,工作目录设置为
“$FileDir$”


你真的需要展示一种比这更好的方式。您可能只是没有指向pytest要运行的正确位置。您正在运行什么命令,您的项目是如何结构的(即,您的测试位于何处)。您是否按照教程进行了操作,以确保所有内容都按其要求进行了配置?它找不到任何要运行的测试,因此没有运行任何测试。谢谢@JohnGordon,感谢您的帮助。