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

Uploaded Source

Built Distributions

TAP_Producer-1.5.12-cp313-none-any.whl (28.4 kB view details)

Uploaded CPython 3.13

TAP_Producer-1.5.12-cp312-none-any.whl (28.5 kB view details)

Uploaded CPython 3.12

TAP_Producer-1.5.12-cp311-none-any.whl (29.1 kB view details)

Uploaded CPython 3.11

File details

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

File metadata

  • Download URL: TAP-Producer-1.5.12.tar.gz
  • Upload date:
  • Size: 70.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for TAP-Producer-1.5.12.tar.gz
Algorithm Hash digest
SHA256 d0fc5c1a986fca012ad70f3247b5f8163c4f71f6b8a21861ff90015374e7fb9c
MD5 8e05600a8bd706e94258ab9c143ca9de
BLAKE2b-256 b4225bf31a872e5ca7099bd5001cc09b7ecb9e5c3d7decd54acfd39830d7ec55

See more details on using hashes here.

Provenance

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

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for TAP_Producer-1.5.12-cp313-none-any.whl
Algorithm Hash digest
SHA256 8d041f569a6ae9779cc583bd204a3993d5ad26d25ad655766a51fbdf98d560aa
MD5 0491b25b8cfef5746785e8691c839b68
BLAKE2b-256 056563ac38a49e7b2b7413cfcaa51052b5bf72e8ca9b37df4f57b34d7ece7e75

See more details on using hashes here.

Provenance

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

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for TAP_Producer-1.5.12-cp312-none-any.whl
Algorithm Hash digest
SHA256 74477e01af7bfc196aaf002c6a3633f6a84aef0d63767c5c6c1eb98b1e18068d
MD5 cc3bb9e9830536c22ff6e31358fa7eb6
BLAKE2b-256 e1f27de2befcd8f3dce2c5659c1f589c15265aee0c5bd0e6b4ff27ce0ecfbca8

See more details on using hashes here.

Provenance

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

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for TAP_Producer-1.5.12-cp311-none-any.whl
Algorithm Hash digest
SHA256 63f32345f738156ab9c697a9ff8b9cde5651a9453837d652c4e65b45daca5761
MD5 660c84d1c198e220d36d0fecfdb43568
BLAKE2b-256 f3b296df94fee96aca4bf15760881a7ab0bca50003b4d39f0ecf7a074212a853

See more details on using hashes here.

Provenance

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

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page