• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
没有阳光天空也是素颜
博客园 首页 新随笔 联系 订阅 订阅 管理

2019年3月13日

pytest启动浏览器,失败用例截图
摘要: 1、conftest.py 2、test_01.py 3、test_03.py 4、cmd运行用例:pytest --html=report.html --self-contained-html 5、运行结果: 阅读全文
posted @ 2019-03-13 19:56 没有阳光天空也是素颜 阅读(2237) 评论(0) 推荐(0)
 
解决pycharm问题:module 'pip' has no attribute 'main'
摘要: 前言:更新pip之后,Pycharm安装package出现报错:module 'pip' has no attribute 'main' 1.找到pycharm的安装目录下的 helpers/packaging_tool.py文件 2.修改代码 修改前: 修改后: 3.再次尝试pycharm安装就可 阅读全文
posted @ 2019-03-13 17:15 没有阳光天空也是素颜 阅读(855) 评论(0) 推荐(0)
 
pytest的HTML
摘要: 安装html: 1.github上源码地址【https://github.com/pytest-dev/pytest-html】 2.pip安装 pip install pytest-html 3.cmd执行用例,生成报告 pytest --html=report.html 4.上面方法生成的报告, 阅读全文
posted @ 2019-03-13 15:00 没有阳光天空也是素颜 阅读(344) 评论(0) 推荐(0)
 
pytest 的 yield
摘要: 前言:1、当 pytest.fixture(scope="module") 时,pytest的yieId 类似unittest的teartownclass 2、当 pytest.fixture(scope="function") 时,pytest的yieId 类似unittest的teartown 阅读全文
posted @ 2019-03-13 14:11 没有阳光天空也是素颜 阅读(1635) 评论(0) 推荐(1)
 
pytest的setup和teardown
摘要: 用例运行级别 函数级(setup_function/teardown_function)只对函数用例生效(不在类中) 类级(setup_class/teardown_class)只在类中前后运行一次(在类中) 方法级(setup_method/teardown_method)开始于方法始末(在类中) 阅读全文
posted @ 2019-03-13 11:10 没有阳光天空也是素颜 阅读(715) 评论(0) 推荐(0)
 
pytest的fixture和conftest
摘要: 解决问题:用例1需要先登录,用例2不需要登录,用例3需要先登录。很显然这就无法用setup和teardown来实现了,这个时候就可以自定义测试用例的预置条件,比setup灵活很多。 1、fixture的使用,以及 scope = function 和 scope = module 的区别 运行结果: 阅读全文
posted @ 2019-03-13 10:51 没有阳光天空也是素颜 阅读(706) 评论(0) 推荐(0)
 
 

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3