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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file ndjson_testrunner-1.1.2.tar.gz.

File metadata

  • Download URL: ndjson_testrunner-1.1.2.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for ndjson_testrunner-1.1.2.tar.gz
Algorithm Hash digest
SHA256 77de0619ba25df8e1ec9fa337c3f83a80328e707c795628fd71d648fa9e6f90d
MD5 c2e6535404684dbafcb834b93b8c44b2
BLAKE2b-256 423f1cdfff7b9bd0d469632db0a48c8a4be7ff41bfd57bc2138f29dea9418b11

See more details on using hashes here.

Provenance

File details

Details for the file ndjson_testrunner-1.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ndjson_testrunner-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 46d410e9638267b31f96f0bdcdbbab273cfdaf8a8b3e81ddc18df219bb2c3564
MD5 57b627dbb1f99e60a80e6c30afb28c9f
BLAKE2b-256 3cdc1255d8733e1ff461b6aee0af0f67a5360ae6668e516a6d4129c328b5fabf

See more details on using hashes here.

Provenance

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