Skip to main content

No project description provided

Project description

pytest-flexreport

1、介绍

pytest-flexreport是针对pytest的生成html报告的插件,自动收集用例执行的详细日志信息,以及相关错误和输出信息。 使用起来非常简单,安装好pytest-testreport之后,运行用例时加上参数即可生成报告

2、安装

pytest-testreport是基于python3.7+开发的,安装前请确认你的python版本>3.7

安装命令

pip install pytest-flexreport

3、快速开始

注意:如果安装了pytest-html这个插件,可能会有冲突,如果冲突则先卸载pytest-html
3.1 template介绍
  • --template=1:白底报告,以用例为维度,含详情
  • --template=2:蓝底报告,以用例为维度,含详情
  • --template=3:蓝底报告,结果概述,统计模块通过率(使用场景:邮件发送summary)
3.2 使用案例
  • 命令行执行: pytest 运行测试时加上参数--report 指定报告文件名
    # 指定报告文件名
    pytest --report=demo-report.html
    
    #其他配置参数
    --template=3, 测试报告模板选择(1,2,3)
    --report=/*/*.html, 报告生成绝对路径
    --history_dir=history.json的目录路径,默认使用html文件同级目录
    --title=测试报告标题, 回填到报告
    --tester=测试人员,回填到报告
    --desc=测试构建描述,回填到报告
    --log_path=测试日志路径, 回填到报告(template=3)
    --report_path=测试报告详情路径, 回填到报告(template=3)
    --testcase_basename=测试用例root-dir basename, 供遍历__init__.py查找模块名(template=3)
    
    # 同时使用多个参数
    pytest --report=report.html --history_dir=./reports --title=测试报告 --tester=txu --desc=项目描述
    
  • pytest.main执行
    import pytest
    
    pytest.main(['--report=demo-report.html',
                 '--history_dir=./reports',
                 '--title=测试报告标题',
                 '--tester=txu',
                 '--desc=报告描述信息'])
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-flexreport-1.2.6.tar.gz (247.9 kB view details)

Uploaded Source

Built Distribution

pytest_flexreport-1.2.6-py2.py3-none-any.whl (253.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pytest-flexreport-1.2.6.tar.gz.

File metadata

  • Download URL: pytest-flexreport-1.2.6.tar.gz
  • Upload date:
  • Size: 247.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for pytest-flexreport-1.2.6.tar.gz
Algorithm Hash digest
SHA256 d724a4b3f7055a7134120f91bdd4070f15ecfbe94be6509b1ba844f1e28f70ca
MD5 5fde19fa400ce492c2c9259509eb4e30
BLAKE2b-256 2f772fae779525450b082b9b4b99b2cca6a396883308859f1e56c881850c8d00

See more details on using hashes here.

File details

Details for the file pytest_flexreport-1.2.6-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_flexreport-1.2.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2a56700bcb4d09fcc19fca978764481bcffbeabf3a7838b4d043784299483773
MD5 95330d169ebfa15b171fa9c2176fae8e
BLAKE2b-256 a2382185570469eb1c35b687cbb3ce88dca7fbab24e08a98c89867bafe4d65ed

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page