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

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

TAP_Producer-1.5.3-cp313-none-any.whl (28.3 kB view details)

Uploaded CPython 3.13

TAP_Producer-1.5.3-cp312-none-any.whl (28.3 kB view details)

Uploaded CPython 3.12

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

Uploaded CPython 3.11

TAP_Producer-1.5.3-cp310-none-any.whl (23.4 kB view details)

Uploaded CPython 3.10

File details

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

File metadata

  • Download URL: TAP-Producer-1.5.3.tar.gz
  • Upload date:
  • Size: 37.3 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.3.tar.gz
Algorithm Hash digest
SHA256 78a92b95ecb9bbb703888dce03f94fd55e9e82076d74bcd53b116054a5a157d1
MD5 04e475b142d2c9c4e7281d8659122a4f
BLAKE2b-256 41ccd3c6319d489bb020a974c5068dee89f5810b5f865e72a60c13e810235da8

See more details on using hashes here.

Provenance

The following attestation bundles were made for TAP-Producer-1.5.3.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.3-cp313-none-any.whl.

File metadata

  • Download URL: TAP_Producer-1.5.3-cp313-none-any.whl
  • Upload date:
  • Size: 28.3 kB
  • Tags: CPython 3.13
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for TAP_Producer-1.5.3-cp313-none-any.whl
Algorithm Hash digest
SHA256 62cb62f4b530eb61f16376b54d92c07aa8a9820260dae2c9509c85e551b6353c
MD5 82ea99f927ee3cab71475f627a26c47f
BLAKE2b-256 79f5e1be6a16e49ce5954e9120c236b75b799f8a431a22b2a0df69d9387d0852

See more details on using hashes here.

Provenance

The following attestation bundles were made for TAP_Producer-1.5.3-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.3-cp312-none-any.whl.

File metadata

  • Download URL: TAP_Producer-1.5.3-cp312-none-any.whl
  • Upload date:
  • Size: 28.3 kB
  • Tags: CPython 3.12
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for TAP_Producer-1.5.3-cp312-none-any.whl
Algorithm Hash digest
SHA256 32a096acb64132c3dc92fc084faaa70bedf2bdefd6dc4d4e90491c428c0972e6
MD5 3c3d83e28d7523d803aec6ba0f1d4e22
BLAKE2b-256 9a099cf9836d83ae878ead29ed7a2d61bf75d92bfde949dad916e8ba53b69747

See more details on using hashes here.

Provenance

The following attestation bundles were made for TAP_Producer-1.5.3-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.3-cp311-none-any.whl.

File metadata

  • Download URL: TAP_Producer-1.5.3-cp311-none-any.whl
  • Upload date:
  • Size: 29.1 kB
  • Tags: CPython 3.11
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for TAP_Producer-1.5.3-cp311-none-any.whl
Algorithm Hash digest
SHA256 fa4d2e913598c0f5cd8e9594c1a7afa166a15dac1609c8bf82aa6356a711547b
MD5 861ff7bb97ae3f5d6d4b4b2667dc3b23
BLAKE2b-256 03f13a72bc29d77f3eb5a6a99d9e03cdb84136eec78c50463bfb91291294eb45

See more details on using hashes here.

Provenance

The following attestation bundles were made for TAP_Producer-1.5.3-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.

File details

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

File metadata

  • Download URL: TAP_Producer-1.5.3-cp310-none-any.whl
  • Upload date:
  • Size: 23.4 kB
  • Tags: CPython 3.10
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for TAP_Producer-1.5.3-cp310-none-any.whl
Algorithm Hash digest
SHA256 f1bfe9dd9d616720db8c0a1949bc619eaf9a4b8bec4dc3c1df94781bce6907b9
MD5 add858448212edd2f7c7b5d1aa5c9e1e
BLAKE2b-256 c9611ee4fd1690858817ede6a494fe78bfc7c75fcb3534d24e97c6e840e4f0f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for TAP_Producer-1.5.3-cp310-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 Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page