pytest不展示运行结果
2022-04-13 本文已影响0人
吱吱菌啦啦
Q1:运行pytest用例,不展示运行结果,也不展示底部run窗口中的结果目录

解决办法
1、右击pycharm菜单,Preferences | Tools | Python Integrated Tools,搜索pytest,default test runner选择pytest,没安装pytest就点fix按钮安装。

2、运行按钮下拉窗口中选择edit configgurations,把之前运行过的pytest缓存删掉


3、删除pycharm缓存,File | Invalidate Caches

Q2:pytest文件不出现py runner按钮,右键用pytest运行会出现No test were found,配置ok
A:语法问题,注意类名写法,一定是以Test打头
亲测以上方法即可解决