pytest运行报错:fixture ‘user‘ not found
代码用到了pytest,运行时出现fixture ‘xxx’ not found的问题。
1、在运行时出现以下问题:
2、查看原因
我这里是因为代码里用到了一个命名为test、test%的函数名
3、解决
<1> 原因是:由于pycharm中以pytest运行,它会默认把test、test_开头的.py文件当做单元测试,所以需要修改文件名。将test_interview.py 修改为interview.py ,再次运行,成功了。
所以,我这里用到了test函数名,应该也是有问题的(具
原创
2022-03-04 06:34:30 ·
1511 阅读 ·
1 评论