Test Anything Protocol producer API for Python.
Project description
Producer for Test Anything Protocol output in Python.
from tap_producer import TAP
with TAP() as t:
t.ok('passed')
t.ok('also passed')
The TAP class automatically counts test points at call time for TAP version 12, 13, and 14.
from tap_producer import TAP
@TAP(plan=1, version=14)
def f() -> None:
TAP.ok('reason')
f()
TAP can also be used as a function decorator.
from tap_producer import TAP
TAP.version(14)
TAP.ok('passed')
TAP.end()
The TAP class can also be used as a purely functional API. Normally TAP calls end() on its own.
from tap_producer import TAP
with TAP() as t:
t.ok('passed').comment('debug information')
if FAIL_CONDITION:
t.not_ok('did not pass')
t.bail_out()
TAP using version 12 supports plan, ok, not ok, diagnostic comment, and bail out functionality.
with TAP(version=13).subtest('subtest') as st:
st.plan(count=1, skip_count=0).ok('ok', {'yaml-key': 'yaml-val'})
TAP version 13 supports the aforementioned as well as subtest context manager and YAML diagnostic output.
from tap_producer import TAP
with TAP() as t:
with t.suppress():
t.ok('passed but suppressed')
with t.strict()
t.not_ok('this is now a Python exception')
TAP-Producer also includes two decorators, a suppress context manager for suppressing TAP output and a strict context manager for raising not ok test cases to Python errors.
License
Licensed Apache-2.0 WITH LLVM-exception, no NOTICE file needed if you want to vendor TAP-Producer into your project, see LICENSE.txt for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for TAP_Producer-1.4.0-cp313-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14a3ab6dfa017f30556684f38b2b0bad4683ef1f0feb380773d2d8060130d02d |
|
MD5 | 5a5f50cae2ad77198651d32668c606c5 |
|
BLAKE2b-256 | 79a1ae66a6f035d753c87faa243c501dbeb84929677bb36d0458d64fc8e83a17 |
Hashes for TAP_Producer-1.4.0-cp312-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 967cf9f47bb44f973e264bb8a05d125680edeb03ba3224b51b86edd4b090184f |
|
MD5 | c6b73513cc5a493acee9e547d10cf370 |
|
BLAKE2b-256 | ef1c8dbdcdfc8df4f6e836a3117ab29d2f57f475e3ec3f149d5cff8cfde9deb1 |
Hashes for TAP_Producer-1.4.0-cp311-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd20fcd202c31ec782dff1ce34f9a459abead6fe2f4e447b652b7811e30f6dbd |
|
MD5 | 4387126bb9b9cee46635b83131b5b6d4 |
|
BLAKE2b-256 | 1901ffd67b18d04b3553bf7d2ab92990f8e04905985440709393130be869417b |
Hashes for TAP_Producer-1.4.0-cp310-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02a82d9c0ec631a1d9d3fdb8edab146f27f32103e47fa5adf333b2a05ac518c3 |
|
MD5 | 85ef3eaaa2807daa3c522bdc2ea53147 |
|
BLAKE2b-256 | 1a824f0ae8efced947e5a623d94474ff9a9392115e8e61480f92fcda2f212a0c |