跳转到主要内容

输出换行分隔的JSON结果的测试运行器

项目描述

导出JSONTestRunner,一个unittest TestRunner类,输出ndjson。每个测试结果一个JSON记录

{
        "type": "success" | "expected_failure" | "failure" | "error" | "unexpected_success" | "skip",
        "id":   "module.TestClass.test_function",
        "desc": null | "First line of test function docstring",
        "msg":  null | "Exception traceback or reason for skipping"
}

用于测试结果存储或进程间通信。

用法

程序化使用

>>> import unittest
>>> from ndjson_testrunner import JSONTestRunner
>>> unittest.main("test_module_name", testRunner=JSONTestRunner)

或从命令行

python -m ndjson_testrunner test_module_name

查看例如IRKernel的用法

项目详情


下载文件

为您的平台下载文件。如果您不确定要选择哪个,请了解更多关于安装包的信息。

源代码分发

ndjson_testrunner-1.1.3.tar.gz (18.2 kB 查看哈希值)

上传时间: 源代码

构建分发

ndjson_testrunner-1.1.3-py3-none-any.whl (16.1 kB 查看哈希值)

上传时间 Python 3

支持者