Skip to main content

Test Anything Protocol producer API for Python.

Project description

Producer for Test Anything Protocol output in Python. Automatically counts test points at call time for TAP version 12, 13, and 14.

from tap_producer import TAP
with TAP() as t:
  t.ok('passed')
  t.ok('also passed')

TAP version 12 supports plan, ok, not ok, diagnostic comment, and bail out functionality.

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 version 13 supports the aforementioned as well as subtest context manager and YAML diagnostic output.

with TAP.subtest('subtest') as st:
   st.plan(count=1, skip_count=0).ok('ok', {'yaml-key': 'yaml-val'})

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.

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

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.

https://raw.githubusercontent.com/sigstore/community/main/artwork/badge/sigstore_codesigned_purple.png

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

TAP-Producer-1.3.3.tar.gz (29.9 kB view hashes)

Uploaded Source

Built Distributions

TAP_Producer-1.3.3-cp313-none-any.whl (21.2 kB view hashes)

Uploaded CPython 3.13

TAP_Producer-1.3.3-cp312-none-any.whl (21.2 kB view hashes)

Uploaded CPython 3.12

TAP_Producer-1.3.3-cp311-none-any.whl (21.9 kB view hashes)

Uploaded CPython 3.11

TAP_Producer-1.3.3-cp310-none-any.whl (17.3 kB view hashes)

Uploaded CPython 3.10

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