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.1-cp313-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2733a5f1094bfdabbb1fb95b34c3ec18895b584a5afb0a0452610fe8d9023fb4 |
|
MD5 | 880197c55fe9a35af34d032ad159005e |
|
BLAKE2b-256 | d2f44c7fbf10fb576700298339ae55bfcd4c6bf8d2bc6827b8a87ac37a7f1241 |
Hashes for TAP_Producer-1.4.1-cp312-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 148e896a44c2a76409ae76419ccd5a5c42a25109dc6dd8294de69a41f29fc424 |
|
MD5 | 0ab567a5aaeffd24db89def88e2225b6 |
|
BLAKE2b-256 | 6203a69043fe30cc78db8027c1342d2ca06123d815cccf74793ecd8a9f538b88 |
Hashes for TAP_Producer-1.4.1-cp311-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf9a4071a6a17b5c5f4fccc9764a2b193f14cb2aa1772c2512698d9b583ae307 |
|
MD5 | ffb5b90ca83442b220a128c65d2dae0a |
|
BLAKE2b-256 | 99d537ef99b5bcf37047781f1a27212b1a8b33a06686bc7a746db4e7bd4a414c |
Hashes for TAP_Producer-1.4.1-cp310-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73e2159e11047b05bd56276f841487904d72b1bfe413662e00f037cc8e914b90 |
|
MD5 | 4430bdee082e5a1e9753608761ffe0d8 |
|
BLAKE2b-256 | 269c94e46fc19212048ee0334d21be4c05e34032fd6f2e4819d9de5b02a7f25b |