zoukankan      html  css  js  c++  java
  • 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
    

      

      

  • 相关阅读:
    灌注和宝石性道法价比分析
    bzoj1912
    bzoj3504
    poj3580
    bzoj1251
    bzoj3223
    bzoj1212
    bzoj3790
    记一次惨痛的比赛
    bzoj2734
  • 原文地址:https://www.cnblogs.com/myy-py/p/13424514.html
Copyright © 2011-2022 走看看