Skip to main content

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.

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.5.0.tar.gz (32.4 kB view details)

Uploaded Source

Built Distributions

TAP_Producer-1.5.0-cp313-none-any.whl (26.2 kB view details)

Uploaded CPython 3.13

TAP_Producer-1.5.0-cp312-none-any.whl (26.1 kB view details)

Uploaded CPython 3.12

TAP_Producer-1.5.0-cp311-none-any.whl (26.8 kB view details)

Uploaded CPython 3.11

TAP_Producer-1.5.0-cp310-none-any.whl (21.3 kB view details)

Uploaded CPython 3.10

File details

Details for the file TAP-Producer-1.5.0.tar.gz.

File metadata

  • Download URL: TAP-Producer-1.5.0.tar.gz
  • Upload date:
  • Size: 32.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for TAP-Producer-1.5.0.tar.gz
Algorithm Hash digest
SHA256 542fbe9268b261a0bc122c66f0e3cbde16d10cd5b3191bd6431b18939f9e7046
MD5 39034c93fb5d64d252ee74e82105c9f5
BLAKE2b-256 970a7a13120ea36866a00c2d66f0b072bdf6f4aa5f92506c29d5e3225ea74410

See more details on using hashes here.

Provenance

The following attestation bundles were made for TAP-Producer-1.5.0.tar.gz:

Publisher: ozi.yml on OZI-Project/TAP-Producer

Attestations:

File details

Details for the file TAP_Producer-1.5.0-cp313-none-any.whl.

File metadata

File hashes

Hashes for TAP_Producer-1.5.0-cp313-none-any.whl
Algorithm Hash digest
SHA256 152010e3d6d4bcaab79b88951b3d2a2b17a213dfd76ab1279c2dd44dd4d7d631
MD5 ac261640753354c1eb3ea05865e67949
BLAKE2b-256 d56633f2a9c0ed0942bbc937eed318bd4d7647fe6a3f732ab643685c53625b07

See more details on using hashes here.

Provenance

The following attestation bundles were made for TAP_Producer-1.5.0-cp313-none-any.whl:

Publisher: ozi.yml on OZI-Project/TAP-Producer

Attestations:

File details

Details for the file TAP_Producer-1.5.0-cp312-none-any.whl.

File metadata

File hashes

Hashes for TAP_Producer-1.5.0-cp312-none-any.whl
Algorithm Hash digest
SHA256 87a6ae23b0f4a752ff554a718af10ec38c4c066b21ca043c7d569cea4c97dce1
MD5 da5a2d58e57aa8627caa974b67c9c04d
BLAKE2b-256 d533ff9f9693899e809c74b8a439293cdca89fd7fe03909df83d7130352370d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for TAP_Producer-1.5.0-cp312-none-any.whl:

Publisher: ozi.yml on OZI-Project/TAP-Producer

Attestations:

File details

Details for the file TAP_Producer-1.5.0-cp311-none-any.whl.

File metadata

File hashes

Hashes for TAP_Producer-1.5.0-cp311-none-any.whl
Algorithm Hash digest
SHA256 9d17e1b5198f904d4c2cf9a214428a00bc5967ab7090b35b0e3c2e140f3b79ab
MD5 a386519cfe54032e1d5d1391445b79fb
BLAKE2b-256 42e24240160900d0530b43c8e9d30bb7b33f8f4faf34c48bc679e8e3614ff498

See more details on using hashes here.

Provenance

The following attestation bundles were made for TAP_Producer-1.5.0-cp311-none-any.whl:

Publisher: ozi.yml on OZI-Project/TAP-Producer

Attestations:

File details

Details for the file TAP_Producer-1.5.0-cp310-none-any.whl.

File metadata

File hashes

Hashes for TAP_Producer-1.5.0-cp310-none-any.whl
Algorithm Hash digest
SHA256 82d300a4d572cf0254937fafef52bd393eca4525e2b99b7f97fbe0c86a82361b
MD5 81dd83314abf0a2642665634f4864629
BLAKE2b-256 ed578c0d61c15ca1b306c8395a2504d81428ee5d4a65c4c382e450ca92d886bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for TAP_Producer-1.5.0-cp310-none-any.whl:

Publisher: ozi.yml on OZI-Project/TAP-Producer

Attestations:

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