Modern style test report based on unittest framework.
基于unittest框架现代风格测试报告。
特点
- 简洁、美观具有现代风格的测试报告。
- 支持
HTML、XML两种格式。 - 支持
单元、Web UI、API各种类型的测试。 - 集成
邮件/钉钉/企微/飞书发送消息。 - 支持用例
错误/失败重跑。 - 支持标签黑、白名单。
- 针对
Selenium运行失败/错误自动截图。 - 支持多语言:
en、zh-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提供免费的访问域名。
Metadata
Release files for XTestRunner 1.8.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| xtestrunner-1.8.6.tar.gz | 1.1 MB | Without provenance | Details for xtestrunner-1.8.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| xtestrunner-1.8.6-py3-none-any.whl | Python 3 | none | any | Details for xtestrunner-1.8.6-py3-none-any.whl |
Total release size: 2.2 MB
Release files / xtestrunner-1.8.6.tar.gz
| Download URL | xtestrunner-1.8.6.tar.gz |
|---|---|
| Size | 1.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0d4a67a422a1dc4c48430db37b44255e5cf49fd2707c91521d35692eb29b94c4
|
|
BLAKE2b-256 checksum How to use checksums |
c8e99c456a5988d22a7d250e7ea0c415305879b84574306dca9848340a64655b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / xtestrunner-1.8.6-py3-none-any.whl
| Download URL | xtestrunner-1.8.6-py3-none-any.whl |
|---|---|
| Size | 1.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
19f74290f0e2456da7ed21faabf1164fbf6bc6746c252b595a46740680cf64a2
|
|
BLAKE2b-256 checksum How to use checksums |
39e01639c5d3afb9d543175bf12aba211862ff462d2812a0590b6022210d3e83
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Security for XTestRunner 1.8.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.