Coder Social home page Coder Social logo

musen123 / unittestreport Goto Github PK

View Code? Open in Web Editor NEW
62.0 4.0 14.0 7.46 MB

python的Unittest框架扩展库、提供生成HTML测试报告、用例失败重运行、数据驱动、邮件发送测试结果等功能!

License: MIT License

Python 17.48% HTML 82.52%
python unittest

unittestreport's Introduction

unittestreport介绍

1、什么是unittestreport

unittestreport是基于unittest开发的的一个功能扩展库,关于unittestreport最初在开发的时候,最初只是计划开发一个unittest生成html测试报告的模块,所以起名叫做unittestreport。在开发的过程中结合使用者的反馈,慢慢的扩展了更多的功能进去。后续还会持续的扩展和开发一些新的功能,目前实现了以下功能:

  • HTML测试报告生成
  • unittest数据驱动
  • 测试用例失败重运行
  • 多线程并发执行用例
  • 发送测试结果及报告到邮箱
  • 测试结果推送到钉钉
  • 测试结构推送到企业微信

2、安装unittestreport

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

  • 安装命令

    pip install unittestreport

  • 说明:原报告模板中的CDN站点失效了,已在1.4.2版中进行了更换,如果生成的报告样式和图表丢失,请升级unittestreport版本pip install unittestreport==1.4.2

3、使用文档

使用文档地址:https://unittestreport.readthedocs.io/en/latest/

使用问题及维护:

  • 开发者:木森
  • WeChat: python771
  • 大家在使用过程中发现bug,以及使用过程中有什么问题,可以联系我

unittestreport's People

Contributors

musen123 avatar

Stargazers

Qize Gao avatar  avatar  avatar baibn avatar gainovel avatar  avatar  avatar 小王 avatar NoChesky avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar xiaorui16888 avatar  avatar zhenda avatar luojun avatar  avatar  avatar  avatar  avatar oblivious avatar  avatar jaylu2018 avatar  avatar  avatar  avatar 虫师 avatar Auto Fang avatar 猛猛小蚂蚁 avatar LIANG avatar  avatar Geekmonk avatar  avatar Heio avatar  avatar hjy avatar  avatar Kz avatar  avatar  avatar  avatar  avatar  avatar Alan avatar JokerChat avatar  avatar  avatar 石岩 avatar  avatar  avatar  avatar 俺也一样 avatar  avatar  avatar  avatar  avatar 小石头 avatar

Watchers

James Cloos avatar  avatar 小石头 avatar  avatar

unittestreport's Issues

selenium、appium、urllib、requests、unittestreport版本兼容问题

安装的时候版本兼容问题,从安装第一步,陆续安装,陆续出现问题
(1)
pip3 install unittestreport ==1.5.1
unittestreport 1.5.1 requires requests==2.24.0

(2)
pip3 install urllib3 ==1.26.1
selenium 4.5.0 requires urllib3[socks]~=1.26

(3)
pip3 install requests ==2.24.0
requests 2.24.0 requires urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1

(4)
pip3 install requests==2.24.0
selenium 4.5.0 requires urllib3[socks]~=1.26

本来想着,我降级selenium版本,后面发现appium那块又不兼容了,
建议将unittestreport的request兼容版本升级到2.28.1

【已提供修复方案】在windows环境运行时,OutputRedirector的write方法中存在编码处理兼容问题

环境场景:windows,unittest执行时是utf-8编码,测试生僻字需求。
报错:File "D:\Programs\Python\Python310\lib\site-packages\unittestreport\core\testResult.py", line 35, in write
origin_stdout.write(str(s))
UnicodeEncodeError: 'gbk' codec can't encode character '\u9ff7' in position 865: illegal multibyte sequence
分析:origin_stdout.write(str(s))会使用默认windows的gbk编码
解决:尝试使用网上的编码设置方式来修改python模块中的源码,会产生其他乱码问题,后来直接删除此行得到解决

unittestreport的用例描述不能正常显示

环境信息如下:
Mac:10.14.6
python:3.8
pycharm:2019.3
unittestreport:1.3.2

将数据从Excel读出后 进行json处理亦或者直接使用ddt或者list_data均无法正常显示title字段的内容,使用代码内的文档注释可正常显示;请协助排查。谢谢

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.