使用pytest执行测试用例报错如下:AttributeError FixtureLookupErrorRepr object has no attribute reprcrash
这个错误通常是由于pytest版本不兼容导致的。
解决方法:
1.卸载当前的pytest,使用pip install pytest==5.4.3安装较为稳定的版本。
2.检查你的代码中是否有重复的fixture名称,如果有,需要将其改为不同的名称。
3.如果以上两个方法都无法解决问题,可以尝试更新pytest到最新版本。
原文地址: https://www.cveoy.top/t/topic/frhQ 著作权归作者所有。请勿转载和采集!