• 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开头的模块文件。

  • 相关阅读:
    vb移动窗体的代码
    vb得到一个进程的启动参数?
    UTF8方式读写文件的模块
    JavaScript中Window.event详解
    vb设置窗体不可移动
    一拖二
    实习第一天
    사랑해
    决定考研
    Eclipse快捷键
  • 原文地址:https://www.cnblogs.com/flhw/p/15614372.html
Copyright © 2020-2023  润新知