zoukankan      html  css  js  c++  java
  • pytest文档40-allure报告清空上一次运行的记录(--clean-alluredir)

    前言

    使用allure 生成报告的时候,当你的用例名称修改后,会发现保留了上一次的用例运行记录。
    如果你想先清空之前的记录再生成新的报告,可以再运行用例的时候加上 --clean-alluredir 命令行参数。

    问题描述

    allure报告可以记录你用例每次执行的情况,这样方便跟踪用例的成功率

    但是也会带来一个新的问题,当你代码里面的用例删除或者更换名称后,依然会记录之前的用例报告

    --clean-alluredir 清空

    如果你想每次用例执行之前先清空allure的报告记录,可以加个参数 --clean-alluredir
    使用 pytest -h 可以查看报告相关的三个参数

    reporting:
      --alluredir=DIR       Generate Allure report in the specified directory (may
                            not exist)
      --clean-alluredir     Clean alluredir folder if it exists
      --allure-no-capture   Do not attach pytest captured logging/stdout/stderr to
                            report
    

    reporting 报告相关参数
    --alluredir=DIR 指定报告的目录路径
    --clean-alluredir 如果已经存在报告,就先清空它
    --allure-no-capture 不加载 logging/stdout/stderr 文件到报告

    带上 clean-alluredir 参数重新执行用例

    pytest --alluredir ./report/allure_report --clean-alluredir
    allure serve ./report/allure_report

  • 相关阅读:
    Matplotlib介绍
    过拟合与欠拟合
    EM最大期望算法
    深度学习之卷积神经网络CNN及tensorflow代码实例
    朴素贝叶斯及贝叶斯网络简介
    迁移学习简介
    Tensorflow 之物体检测
    tensorflow object detection API
    ubuntu17.04中启动Tensorboard过程
    deep learning 经典网络模型之Alexnet、VGG、Googlenet、Resnet
  • 原文地址:https://www.cnblogs.com/yoyoketang/p/13028203.html
Copyright © 2011-2022 走看看