Skip to main content

A test runner that outputs newline delimited JSON results

Project description

Exports JSONTestRunner, a unittest TestRunner class that outputs ndjson. One JSON record per test result:

{
        "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"
}

To be used for test result storage or interprocess communication.

Usage

Use it programmatically:

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

or from the command line:

python -m ndjson_testrunner test_module_name

Check out e.g. how IRKernel’s usage looks.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ndjson_testrunner-1.1.2.tar.gz (18.2 kB view hashes)

Uploaded Source

Built Distribution

ndjson_testrunner-1.1.2-py3-none-any.whl (15.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page