New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

XTestRunner

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

XTestRunner

Modern style test report based on unittest framework.

  • 1.8.4
  • PyPI
  • Socket score

Maintainers
1

Modern style test report based on unittest framework.

基于unittest框架现代风格测试报告。

特点

  • 简洁、美观具有现代风格的测试报告。
  • 支持HTMLXML两种格式。
  • 支持单元Web UIAPI各种类型的测试。
  • 集成邮件/钉钉/企微/飞书 发送消息。
  • 支持用例错误/失败重跑。
  • 支持标签黑、白名单。
  • 针对Selenium运行失败/错误自动截图。
  • 支持多语言:enzh-CN(注:仅HTML格式)。

Report

Install

> pip install XTestRunner

If you want to keep up with the latest version, you can install with github repository url:

> pip install -U git+https://github.com/SeldomQA/XTestRunner.git@master

demo

查看更多使用 例子

  • unittest测试
import unittest
from XTestRunner import HTMLTestRunner


class TestDemo(unittest.TestCase):
    """测试用例说明"""

    def test_success(self):
        """执行成功"""
        self.assertEqual(2 + 3, 5)

    @unittest.skip("skip case")
    def test_skip(self):
        """跳过用例"""
        pass

    def test_fail(self):
        """失败用例"""
        self.assertEqual(5, 6)

    def test_error(self):
        """错误用例"""
        self.assertEqual(a, 6)


if __name__ == '__main__':
    suit = unittest.TestSuite()
    suit.addTests([
        TestDemo("test_success"),
        TestDemo("test_skip"),
        TestDemo("test_fail"),
        TestDemo("test_error")
    ])

    with(open('./result.html', 'wb')) as fp:
        runner = HTMLTestRunner(
            stream=fp,
            title='<project name>test report',
            description='describe: ... ',
            language='en',
            rerun=3
        )
        runner.run(suit)

Document

更多例子,请阅读 中文文档

其他

感谢

感谢从以下项目中得到思路和帮助。

静态文件服务

1.添加静态文件到github项目。

https://github.com/defnngj/Telegraph-Image

2.cloudflare提供免费的访问域名。

https://dash.cloudflare.com/

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc