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

  • 相关阅读:
    [0] 需求管理工具CaliberRM
    [0] 自动化测试工具QTP
    [0] UML建模工具(StarUML)
    [0] C# 扩展方法(Extension Method)
    [0] 统一软件过程(RUP)
    [0] XP敏捷开发
    关于ES6的let,const与var之间的三生三世
    lumen手记:自定义Validate表单验证
    window下python安装pip,切换为国内阿里云镜像
    Lumen开发:简单实现auth用户认证
  • 原文地址:https://www.cnblogs.com/flhw/p/15614372.html
Copyright © 2011-2022 走看看