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.4.0.tar.gz (31.6 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.4.0-cp313-none-any.whl (26.1 kB view details)

Uploaded CPython 3.13

TAP_Producer-1.4.0-cp312-none-any.whl (26.0 kB view details)

Uploaded CPython 3.12

TAP_Producer-1.4.0-cp311-none-any.whl (26.8 kB view details)

Uploaded CPython 3.11

TAP_Producer-1.4.0-cp310-none-any.whl (21.3 kB view details)

Uploaded CPython 3.10

File details

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

File metadata

  • Download URL: TAP-Producer-1.4.0.tar.gz
  • Upload date:
  • Size: 31.6 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.4.0.tar.gz
Algorithm Hash digest
SHA256 0c1ba24c7e80abc70c550c5fc27fc60e380993502e7b9057abfb4e780280b4d0
MD5 9048fafcc7013a36d13d1fe8b738b5ea
BLAKE2b-256 e38e2f7c82f791cfa1e48a034ad8b287279e226fe22f7679d3f7c8fda1e2e824

See more details on using hashes here.

File details

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

File metadata

  • Download URL: TAP_Producer-1.4.0-cp313-none-any.whl
  • Upload date:
  • Size: 26.1 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.4.0-cp313-none-any.whl
Algorithm Hash digest
SHA256 14a3ab6dfa017f30556684f38b2b0bad4683ef1f0feb380773d2d8060130d02d
MD5 5a5f50cae2ad77198651d32668c606c5
BLAKE2b-256 79a1ae66a6f035d753c87faa243c501dbeb84929677bb36d0458d64fc8e83a17

See more details on using hashes here.

File details

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

File metadata

  • Download URL: TAP_Producer-1.4.0-cp312-none-any.whl
  • Upload date:
  • Size: 26.0 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.4.0-cp312-none-any.whl
Algorithm Hash digest
SHA256 967cf9f47bb44f973e264bb8a05d125680edeb03ba3224b51b86edd4b090184f
MD5 c6b73513cc5a493acee9e547d10cf370
BLAKE2b-256 ef1c8dbdcdfc8df4f6e836a3117ab29d2f57f475e3ec3f149d5cff8cfde9deb1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: TAP_Producer-1.4.0-cp311-none-any.whl
  • Upload date:
  • Size: 26.8 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.4.0-cp311-none-any.whl
Algorithm Hash digest
SHA256 dd20fcd202c31ec782dff1ce34f9a459abead6fe2f4e447b652b7811e30f6dbd
MD5 4387126bb9b9cee46635b83131b5b6d4
BLAKE2b-256 1901ffd67b18d04b3553bf7d2ab92990f8e04905985440709393130be869417b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: TAP_Producer-1.4.0-cp310-none-any.whl
  • Upload date:
  • Size: 21.3 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.4.0-cp310-none-any.whl
Algorithm Hash digest
SHA256 02a82d9c0ec631a1d9d3fdb8edab146f27f32103e47fa5adf333b2a05ac518c3
MD5 85ef3eaaa2807daa3c522bdc2ea53147
BLAKE2b-256 1a824f0ae8efced947e5a623d94474ff9a9392115e8e61480f92fcda2f212a0c

See more details on using hashes here.

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