1、打开pycharm

2、找到settings-Tools-python Integrated Tools,设置为pytest就可以了

pycharm中设置pytest运行_python