pytest踩坑

pytest踩坑

详解AttributeError: ‘Function’ object has no attribute 'get_marker

fixture注解无效,pytest与python版本不匹配,重新更新一下pytest版本,

https://blog.csdn.net/qq_40984307/article/details/105110276?spm=1001.2101.3001.6661.1&utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1.no_search_link&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1.no_search_link&utm_relevant_index=1

 pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pytest

Python*:AttributeError: ‘function’ object has no attribute

https://blog.csdn.net/qq_18704911/article/details/103965549?spm=1001.2101.3001.6650.7&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7Edefault-7.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7Edefault-7.no_search_link

[已解决] Pytest Error: E ModuleNotFoundError: No module named 'common

conftest.py必须放到根目录下,否则报错

https://programmerah.com/solved-pytest-error-e-modulenotfounderror-no-module-named-common-41264/

pytest-rerunfailures不能与pytest 6.1.0以上的版本一起使用,所以卸载pytest-rerunfailures后使用pytest-reportlog来代替即可;

AttributeError: ‘NoneType’ object has no attribute ‘groups’

使用正则表达式时出现

       obj = re.search('"result":{"name":"(.*?)"',res.text)

        print(obj.groups())

正则表达式没有匹配成功,然后还去调用group获取匹配结果时会出现

配置环境变量后编译器无法使用相关命令,尝试一下管理员启动

(2条消息) Pytest使用allure提示unrecognized arguments_kacylining的博客-CSDN博客

你可能感兴趣的:(python学习,pytest,python,开发语言,后端)