当前位置: 首页 > wzjs >正文

万户网络合肥新网站关键词怎么优化

万户网络合肥,新网站关键词怎么优化,昆明百度推广优化,淮南网站建设全包pytest知识了解 pytest的基础知识了解:Python测试框架之pytest详解_lovedingd的博客-CSDN博客_pytest框架 (包含设置断点,pdb,获取最慢的10个用例的执行耗时) pytest-pytest.main()运行测试用例,pytest参数: pytest-…

  pytest知识了解

pytest的基础知识了解:Python测试框架之pytest详解_lovedingd的博客-CSDN博客_pytest框架

(包含设置断点,pdb,获取最慢的10个用例的执行耗时)

pytest-pytest.main()运行测试用例,pytest参数: pytest-pytest.main()运行测试用例,pytest参数_小白爱吃饭的博客-CSDN博客

报错 usage: runAll.py [options] [file_or_dir] [file_or_dir] [...]  ,是由于没有安装pytest-html 

pytest  的使用 

pytest中标签名的使用 :  pytest之mark的使用 - 奔奔-武 - 博客园

Pytest装饰器   @pytest.mark.parametrize 的使用: Python Pytest装饰器@pytest.mark.parametrize详解_探索测试-CSDN博客_pytest.mark.parametrize

@pytest.mark.xfail  : pytest xfail参数详解 - jescs - 博客园

 @pytest.mark.skipif()  

pytest 中的 fixture的使用

pytest 中的 fixture的使用(1):  pytest进阶之fixture - linux超 - 博客园 

pytest 的fixture的使用 (2):Pytest 使用简介 - 三只松鼠 - 博客园

将固件参数化:

 

注意:

1. 需要安装 pytest-html

2. 若出现了 report.html 运行的0 test, 则说明是文件的命名不对

pytest的命名规则:默认从当前目录中搜集测试用例,即在哪个目录下运行 pytest 命令,则中哪个目录中搜索

-符合命令规则 test_*.py 或者 *_test.py 的文件

-以 test_ 开头的函数名

-以 Test 开头的测试类(没有__init__函数)当中,以 test_ 开头的函数

3.  @pytest.fixture() 以及 @pytest.mark.usefixture() 的用法

当function级别的 fixture 没有设置  autouse的时候,  执行完类级别的fixture,会直接执行 类中的函数

当function级别的 fixture 有设置  autouse的时候,  执行完类级别的fixture,会调用函数级别的fixture,再去执行类中的函数

(autouse: 如果为True,则fixture func将为所有测试用例激活可以看到它。如果为False(默认值),则需要显式激活fixture)

4. 上述的案例中,fixture函数 和 测试用例写在同一文件内,如果存在多个py 文件调用的话,则需要建一个 confest文件 ,test_xxx.py 测试文件中无需 import  conftest, pytest 会自动搜索同级目录中的 conftest.py 文件

5. 需要获得返回参数的时候,不可使用 @pytest.mark.usefixtures(),需要直接传参 ,因为fixture中返回的数据默认在fixture名字里面存储

pyte st 的标签的使用 比如 @pytest.mark.demo :

 标签不生效的处理方法:PytestUnknownMarkWarning: Unknown pytest.mark.wallet - is this a typo?..._weixin_30257433的博客-CSDN博客

 Pytest:conftest.py在登录接口上的应用

   Pytest:conftest.py在登录接口上的应用 - 简书

注意: 登录接口: headers 中需要传参qtoken的值 :  'qtoken':'VE9N35WLpFOYrEpOnrXC457xO8U2'

pytest 的 多进程运行cases  以及  重试运行cases 

 py test 在命令行(terminal)运行:

pytest  test_skip.py          #运行test_skip.py文件

pytest -v test_skip.py            #查看详细的运行信息

pytest -m demo testCase/test_Search.py    # 运行 被标记为demo的 用例,比如说有的用例未完成,则可标记为finished,unfinished ,来方便调试 

 pytest使用命令行来运行 测试用例:pytest教程之命令行方式运行用例_df0128的专栏-CSDN博客_pytest执行命令

 pytest  allure的教程

pytest  allure的安装教程 Pytest+Allure生成自动化测试报告 - 一步一脚印丶 - 博客园

安装allure报错提示JAVA_HOME is set to an invalid directory解决办法: 安装allure报错提示JAVA_HOME is set to an invalid directory解决办法_textwj的博客-CSDN博客  

对应的安装 java jdk的教程:JAVA_JDK下载与安装教程_weixin_42687361的博客-CSDN博客_javajdk安装步骤

安装jdk出现could not open 'D:\software\JAVA\lib\amd64\jvm.cfg' 的解决办法    win10安装jdk出现could not open 'D:\software\JAVA\lib\amd64\jvm.cfg'_lin1314yuan的博客-CSDN博客

allure 的用例描述使用 :allure(三十)--allure描述用例详细讲解 - 星空6 - 博客园 

生成allure报告:

方法1:

if __name__ == '__main__':

    pytest.main(['-s', '-q', '--alluredir', './allure'])

    os.system('allure -c ./allure')

    os.system('allure serve ./allure-report')

方法2:

pytest  -n auto --alluredir=yourdir                                 #  -n auto:可以自动检测到系统的CPU核数 使用分布式运行用例  ;   --alluredir=yourdir    #只需添加 --alluredir 选项,并提供指向应存储结果的文件夹的路径   例如:pytest -n auto --alluredir .\report    或者 pytest -n auto --alluredir=report , report是你要放置的文件夹名称

allure serve report       #report 是已生成json , txt 数据的文件夹

方法3:

pytest -sq --alluredir=report     # 执行 pytest,指定 allure 结果目录为report文件夹

allure generate -c -o ./allure-report    report    #根据report文件夹中的文件, 生成 allure 的 html 报告 放在 allure-report文件夹下

allure open ./allure-report     # 打开 allure 报告  

清除之前生成的json,txt文件,生成新的文件

pytest test_2.py  --alluredir=. /report   --clean-alluredir   #report为存放json,txt文件的文件夹 , 注意clean 后面接的是 - ,不是=

allure命令行 :  Pytest 系列(27)- allure 命令行参数 - 小菠萝测试笔记 - 博客园

 yaml文件:

yaml文件的使用   自动化项目配置或用例文件格式推荐--yaml - hyx20160514 - 博客园

yaml 校验器   YAML、YML在线编辑器(格式化校验)-BeJSON.com 


文章转载自:

http://XLjJtqAD.pynzj.cn
http://hDcL1BKR.pynzj.cn
http://stEzEYRe.pynzj.cn
http://Fw9FvdMW.pynzj.cn
http://qmZNcYsJ.pynzj.cn
http://JJuaHrBO.pynzj.cn
http://zHRQaMjr.pynzj.cn
http://4dBUaZk9.pynzj.cn
http://7aVE5He6.pynzj.cn
http://h82gGqWZ.pynzj.cn
http://rqz0pG3w.pynzj.cn
http://MJMmDmiR.pynzj.cn
http://5MkqYH0b.pynzj.cn
http://pSCWneFE.pynzj.cn
http://n9c1s58E.pynzj.cn
http://kT8ILEHb.pynzj.cn
http://twY6geft.pynzj.cn
http://MsJORMij.pynzj.cn
http://0sOSHYiF.pynzj.cn
http://g7nl7phh.pynzj.cn
http://N1BO1rex.pynzj.cn
http://grqZfIOL.pynzj.cn
http://1oAINQJy.pynzj.cn
http://Pa8Dn7pE.pynzj.cn
http://t4LtUaaQ.pynzj.cn
http://iKC3EQ13.pynzj.cn
http://WUIURZjy.pynzj.cn
http://4UlcIjCc.pynzj.cn
http://ppTVMlZI.pynzj.cn
http://hNc2XtIw.pynzj.cn
http://www.dtcms.com/wzjs/704706.html

相关文章:

  • 安徽做网站怎么提高网站的流量
  • 湖南住房和城乡建设厅网站首页台州手机端建站模板
  • 塘沽企业网站建设网站结构优化包括什么
  • 青岛私人做网站网页设计素材包下载
  • 天津网站建设哪家公司好原创设计
  • 网站子栏目设计wordpress广告位代码
  • 网站搭建介绍不备案的网站
  • 山西自助建站系统平台个人网站模板王
  • 海南省建设工程质量安全检测协会网站wordpress 卢晓松
  • 沈阳网站制作做网站按什么收费
  • 呼市做网站wordpress投票功能
  • 食品网站开发的背景医疗器械监督管理条例2021
  • 桂林象鼻山离哪个高铁站近贵阳企业网站
  • 做服饰网站网站搭建同一页不同按钮不同页面
  • 网站可以做外部链接吗51wordpress
  • 全国网站开发公司网站建设会计处理
  • 手机端购物网站模板下载电商网站开发的流程图
  • 如何做网站店铺广州最新静态管理
  • 建站宝盒里的手机网站编程 朋友 做网站
  • 微网站开发流程图泰安房产网信息网官网
  • 网站开发页面设计报告营销策划方案怎么做模板
  • 美食网站代做做视频网站应该选什么服务器
  • 兼容移动端网站开发山东网站建设流程
  • 平凉市网站建设制作网上怎么自己做网站
  • 做网站主机选择给女朋友做网站 知乎
  • 动漫网站建设方案设计最火的电商平台
  • .net网站项目有哪些wordpress play主题
  • 网站m3u8链接视频怎么做的广东网站建设制作价格
  • wordpress 统计小工具关键词优化诊断
  • 手机网站带后台源代码上海网站建设团队杨浦