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

Uploaded CPython 3.13

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

Uploaded CPython 3.12

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

Uploaded CPython 3.11

File details

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

File metadata

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

File hashes

Hashes for TAP-Producer-1.5.10.tar.gz
Algorithm Hash digest
SHA256 d9469518bcc8042ece3add9cc6e380d2adc26af40126a1ceca64ec21357966c4
MD5 13efea2a6806705eda9f6c93c04118f0
BLAKE2b-256 d5d7fe475d8b57868e10f426a9b311df51a68e9185918154dd0184fd88ac943f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: TAP_Producer-1.5.10-cp313-none-any.whl
  • Upload date:
  • Size: 28.4 kB
  • Tags: CPython 3.13
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for TAP_Producer-1.5.10-cp313-none-any.whl
Algorithm Hash digest
SHA256 12fc9be2d26741abc5d073df8926205c59a081472b3b41a99aeaa5935c58f019
MD5 d339af1cf5f1899dde2e09cd71dd9f17
BLAKE2b-256 719f51a074f15ff71e2aa054fa743cd9e547a445bfec2ef3965fc691d1ac41d4

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: TAP_Producer-1.5.10-cp312-none-any.whl
  • Upload date:
  • Size: 28.5 kB
  • Tags: CPython 3.12
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for TAP_Producer-1.5.10-cp312-none-any.whl
Algorithm Hash digest
SHA256 0e0137589bfc5097a025e3eaf1f08591a7b66f5f5b93783e88856795f89366e3
MD5 9afbcf55c40dc7534624ccf6e83b9c0b
BLAKE2b-256 dd743899b5f25972417df548cb40374db7a48111400280c7aed1ea84b82dd418

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for TAP_Producer-1.5.10-cp311-none-any.whl
Algorithm Hash digest
SHA256 6b3e720435a60e5f1d6b801e43acd926e3a9a3082df2927fe25533f6f7c3ff96
MD5 ea3144363274bc2b644a7ba34a54b727
BLAKE2b-256 6ea54db9a2d80a4c01bd69afb514db3c6709d05b4bfb238484c7611798e79228

See more details on using hashes here.

Provenance

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