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

  • 相关阅读:
    java面试第八天
    java面试第七天
    java面试第六天
    java面试第五天
    java面试第四天
    SpringMVC导出Excel
    75. Autorelease机制及释放时机
    关于 SQLNET.AUTHENTICATION_SERVICES 验证方式的说明
    硬件十万个为什么——运放篇(五)PCB设计技巧
    eclipse到Android Studio的项目迁移
  • 原文地址:https://www.cnblogs.com/flhw/p/15614372.html
Copyright © 2011-2022 走看看