• pytest---pytest.ini


    完整:ini中的参数设置

      Configuration Options

    1,格式

    [pytest]
    log_format = %(asctime)s %(levelname)s %(message)s
    
    log_date_format = %Y-%m-%d %H:%M:%S
    

      

    2,addopts

      添加运行参数

      addopts = -q

    3,testpaths

      指定测试用例路径

      testpaths = app/login 

      多个测试路径使用 空格隔开或者换行写

    # testpaths = app/login app/person
    testpaths = 
        app/login 
        app/person
    

      

    4,日志信息设置 

    log_format = %(asctime)s %(levelname)s %(message)s
    log_date_format = %Y-%m-%d %H:%M:%S
    log_level = INFO

    # 实时日志
    log_cli=true
    log_cli_level = INFO
    log_cli_format =
    %(asctime)s %(levelname)s %(message)s
    log_cli_date_format =%Y-%m-%d %H:%M:%S

    # 日志文件

    log_file

    log_file_level

    log_file_format

    log_file_date_format

     

    5,对警告信息进行配置

    [pytest]
    filterwarnings =
        error
        ignore::UserWarning
    

      

    6,对doctest文件的设置

    [pytest]
    addopts = --doctest-modules
    

      

      

  • 相关阅读:
    场景法设计测试用例
    编写边界条件测试用例原则
    CSS
    JavaScript
    HTML
    lamp安装教程
    Linux(lamp安装)
    oracle sqlplus常用命令
    利用同步器实现互斥锁
    工厂模式--简单工厂模式
  • 原文地址:https://www.cnblogs.com/myy-py/p/13424514.html
Copyright © 2020-2023  润新知