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.18.tar.gz (72.8 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.18-cp313-none-any.whl (28.4 kB view details)

Uploaded CPython 3.13

tap_producer-1.5.18-cp312-none-any.whl (28.3 kB view details)

Uploaded CPython 3.12

tap_producer-1.5.18-cp311-none-any.whl (29.1 kB view details)

Uploaded CPython 3.11

File details

Details for the file tap_producer-1.5.18.tar.gz.

File metadata

  • Download URL: tap_producer-1.5.18.tar.gz
  • Upload date:
  • Size: 72.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tap_producer-1.5.18.tar.gz
Algorithm Hash digest
SHA256 07bcc36701e3eddccac8f73bcfe9a2424d2d1b39c04825953882267cefbbb913
MD5 b365e076a1fc7978cd0c354c1527e118
BLAKE2b-256 df095e2a49978b6eb947473c6a0c84ed0eb9098ae9732ad021baa8d90392e576

See more details on using hashes here.

Provenance

The following attestation bundles were made for tap_producer-1.5.18.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.18-cp313-none-any.whl.

File metadata

  • Download URL: tap_producer-1.5.18-cp313-none-any.whl
  • Upload date:
  • Size: 28.4 kB
  • Tags: CPython 3.13
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tap_producer-1.5.18-cp313-none-any.whl
Algorithm Hash digest
SHA256 c3221604f5cd20975d0a28d084ff947b929d60ee1ba7a33c9a190fb53ed7ea18
MD5 4fd277087253f1569f9df2593f68b416
BLAKE2b-256 3a05111636909784a017018fdb0e4eec245e19637caf9c743e5a77b24b138a0c

See more details on using hashes here.

Provenance

The following attestation bundles were made for tap_producer-1.5.18-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.18-cp312-none-any.whl.

File metadata

  • Download URL: tap_producer-1.5.18-cp312-none-any.whl
  • Upload date:
  • Size: 28.3 kB
  • Tags: CPython 3.12
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tap_producer-1.5.18-cp312-none-any.whl
Algorithm Hash digest
SHA256 3c706d4c4e09035203f96bea9552c630ace0495c010f4c26eac81b926211b89a
MD5 c3bf19d9cad77558d6d21d750c404b99
BLAKE2b-256 a6cb08ee90d99a98279b010ec8367ee64efadea145cd9312e3a1896bfafa2cb7

See more details on using hashes here.

Provenance

The following attestation bundles were made for tap_producer-1.5.18-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.18-cp311-none-any.whl.

File metadata

  • Download URL: tap_producer-1.5.18-cp311-none-any.whl
  • Upload date:
  • Size: 29.1 kB
  • Tags: CPython 3.11
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tap_producer-1.5.18-cp311-none-any.whl
Algorithm Hash digest
SHA256 a3ad8a0414274dabe3c0c37434c7b6b7fee0d99425fdecd2973c1c5f4c271b1a
MD5 8743178e8fdca4f26b2b1c9e2b5e3424
BLAKE2b-256 b4e1242e5e39626209fc1b923c9954f4106c12c7605fe4c90bdcf7707fac4335

See more details on using hashes here.

Provenance

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