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

Uploaded CPython 3.13

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

Uploaded CPython 3.12

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

Uploaded CPython 3.11

File details

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

File metadata

  • Download URL: TAP-Producer-1.5.13.tar.gz
  • Upload date:
  • Size: 70.9 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.13.tar.gz
Algorithm Hash digest
SHA256 4c1eff43c8aa889f002e2c7defe4d3437534796b77f3f41ed1a0f5978970e077
MD5 80122c9a662a9eb9ea9ca0ca42d929e4
BLAKE2b-256 b8672d6d31318290628cf2fb1c64970369dc1692c95c78c1151780c70078d1f8

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: TAP_Producer-1.5.13-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.13-cp313-none-any.whl
Algorithm Hash digest
SHA256 fa5745eec6d63363f6d73a1c763cb66d7e6fabdb174bbe6ad649d1426c74873a
MD5 45fed801330e454c9929a3b8a4045b13
BLAKE2b-256 2a385f3940d33b63b9dd1f6339db4e7601c4ad32f68a63e780421b0ee8db4e0d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: TAP_Producer-1.5.13-cp312-none-any.whl
  • Upload date:
  • Size: 28.5 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.13-cp312-none-any.whl
Algorithm Hash digest
SHA256 56d04d3a0526bbdfa22e84b71ce4f7ce3af99f8105c89919c69f4fd348deb0a9
MD5 3870e7ba08538858ad2ca68d0f682f6e
BLAKE2b-256 3be6a1a425e7be52d2718c5dd9c10df9ca5572a5d994e34a55bf0da4b864aa28

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: TAP_Producer-1.5.13-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.13-cp311-none-any.whl
Algorithm Hash digest
SHA256 c78235d049d562b112bb0eaa9d0ab9a87042d493971197fbe5c3322774962c3c
MD5 12a90b1410559397d5813c1c15061c77
BLAKE2b-256 fb9a24bbe9c6d49aed2444e8915c03c3d363aff6fab43017664f5ee6a7daeec6

See more details on using hashes here.

Provenance

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