zoukankan      html  css  js  c++  java
  • httpruner3 运行

    hrun只是包装了pytest框架,可以直接使用pytest命令运行,把hrun改成pytest即可

    注意点:pytest命令只针对.py文件使用,yaml/json文件的得用hrun

    如果用hrun会出现

     testcase/testsuite file should be YAML/JSON format
    

    pytest的ini配置文件
    pytest.ini文件是pytest的主配置文件,可以改变pytest的默认行为。
    1.pytest.ini的放置位置:一般放在项目工程的根目录(即当前项目的顶级文件夹下)
    2.pytest.ini的作用:指定pytest的运行方式(在cmd输入pytest后,会读取pytest.ini中的配置信息,按指定的方式去运行)
    3.cmd下使用 pytest -h 命令查看pytest.ini的设置选项(以下截图只是部分选项)
    常用设置选项如下:
    [pytest]
    addopts = -s … #可添加多个命令行参数,用空格分隔
    testpaths = …/pytestproject #测试用例文件夹,可自己配置,…/pytestproject为上一层的pytestproject文件夹。
    python_files = test.py #配置测试搜索的模块文件名称
    python_classes = Test
    #配置测试搜索的测试类名
    python_funtions = test #配置测试搜索的测试函数名

    示例如下:

    [pytest]
    addopts = -s --html=./reports/report.html
    testpaths = ./testcases
    python_files = test.py
    python_classes = Test

    python_funtions = test*
    注意:
    1.运行的时候自动读取配置文件,运行pytestproject下的所有test开头的模块文件。

  • 相关阅读:
    docker stats
    Appium 环境搭建
    docker 进入容器
    Mac下Mysql启动异常["ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)"]
    python 虚拟环境--virtualenv
    visjs 绘图 图标 动态添加数据
    js 滑块登录验证
    js iframe 最顶层显示
    转化为数组
    videojs双击全屏幕观看,videojs动态加载视频
  • 原文地址:https://www.cnblogs.com/flhw/p/15614372.html
Copyright © 2011-2022 走看看