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.1.tar.gz (31.7 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.1-cp313-none-any.whl (26.2 kB view details)

Uploaded CPython 3.13

TAP_Producer-1.4.1-cp312-none-any.whl (26.1 kB view details)

Uploaded CPython 3.12

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

Uploaded CPython 3.11

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

Uploaded CPython 3.10

File details

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

File metadata

  • Download URL: TAP-Producer-1.4.1.tar.gz
  • Upload date:
  • Size: 31.7 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.1.tar.gz
Algorithm Hash digest
SHA256 198ef79cfa5c310cf8734fbc5318b55bd9bb70485119c74a3d2d2e24d7cdf415
MD5 5331b160588feccaae94679df3af7311
BLAKE2b-256 6211af3298ffdeafcc672b19a6d30d826a407f5459a2ca5af912fe12c875748d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: TAP_Producer-1.4.1-cp313-none-any.whl
  • Upload date:
  • Size: 26.2 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.1-cp313-none-any.whl
Algorithm Hash digest
SHA256 2733a5f1094bfdabbb1fb95b34c3ec18895b584a5afb0a0452610fe8d9023fb4
MD5 880197c55fe9a35af34d032ad159005e
BLAKE2b-256 d2f44c7fbf10fb576700298339ae55bfcd4c6bf8d2bc6827b8a87ac37a7f1241

See more details on using hashes here.

File details

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

File metadata

  • Download URL: TAP_Producer-1.4.1-cp312-none-any.whl
  • Upload date:
  • Size: 26.1 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.1-cp312-none-any.whl
Algorithm Hash digest
SHA256 148e896a44c2a76409ae76419ccd5a5c42a25109dc6dd8294de69a41f29fc424
MD5 0ab567a5aaeffd24db89def88e2225b6
BLAKE2b-256 6203a69043fe30cc78db8027c1342d2ca06123d815cccf74793ecd8a9f538b88

See more details on using hashes here.

File details

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

File metadata

  • Download URL: TAP_Producer-1.4.1-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.1-cp311-none-any.whl
Algorithm Hash digest
SHA256 bf9a4071a6a17b5c5f4fccc9764a2b193f14cb2aa1772c2512698d9b583ae307
MD5 ffb5b90ca83442b220a128c65d2dae0a
BLAKE2b-256 99d537ef99b5bcf37047781f1a27212b1a8b33a06686bc7a746db4e7bd4a414c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: TAP_Producer-1.4.1-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.1-cp310-none-any.whl
Algorithm Hash digest
SHA256 73e2159e11047b05bd56276f841487904d72b1bfe413662e00f037cc8e914b90
MD5 4430bdee082e5a1e9753608761ffe0d8
BLAKE2b-256 269c94e46fc19212048ee0334d21be4c05e34032fd6f2e4819d9de5b02a7f25b

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