Skip to main content

pytest-testreport

1、pytest-testreport介绍

pytest-testreport-new是一个针对pytest的生成html报告的插件,基于开源工具pytest-testreport的修改,使用起来非常简单,安装好pytest-testreport-new之后,运行用例时加上参数即可生成报告

注意点:如果安装了pytest-html这个插件,请先卸载,不然会有冲突
使用案例:
  • 命令行执行: pytest 运行测试时加上参数--report 指定报告文件名
    # 指定报告文件名
    pytest --report=report.html
    
    #其他配置参数
    --title=指定报告标题
    --tester=指定报告中的测试者
    --desc = 指定报告中的项目描述
    
    # 同时使用多个参数
    pytest --report=report.html --title=测试报告 --tester=测试菜鸟 --desc=项目描述
    
  • pytest.main执行
    import pytest
    
    pytest.main(['--report=musen.html',
                 '--title=测试报告标题',
                 '--tester=tester',
                 '--desc=报告描述信息'])
    

2、安装pytest-testreport

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

安装命令

pip install pytest-testreport-new

Release files for pytest-testreport-new 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-testreport-new 0.0.6
File Size Uploaded
pytest-testreport-new-0.0.6.tar.gz 18.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-testreport-new 0.0.6
File Interpreter ABI Platform
pytest_testreport_new-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 38.8 kB

Release files / pytest-testreport-new-0.0.6.tar.gz

Download URL pytest-testreport-new-0.0.6.tar.gz
Size 18.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ab2d50aa6e8abed92b9cf31e80274b31b71e211220b8b9240084659d7827a6bd
BLAKE2b-256 checksum
How to use checksums
5e484586f9d2fcbfac15ea2d0625e5ea0560d0667d20b8f8b9e943a7466309bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.6

Release files / pytest_testreport_new-0.0.6-py3-none-any.whl

Download URL pytest_testreport_new-0.0.6-py3-none-any.whl
Size 20.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
643db9dd601bb89884c568dc296c626b37ab4dee0c4aa7b8f60712c334d4f975
BLAKE2b-256 checksum
How to use checksums
75573ada92d88194d00157932f42221b48120e6f75b37c5d0825cac16b5b7d4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page