Skip to main content

Pytest decorators for the Klab Pytest Toolkit

Project description

Klab Pytest Toolkit - Decorators

Custom pytest decorators for marking and annotating tests.

At the moment the package provides the following decorator:

  • @requirement(id: str): Marks a test with a requirement ID for traceability. The ID is added to the junit xml output.

Installation

pip install klab_pytest_toolkit_decorators

Usage

Requirement Decorator

Mark tests with requirement IDs for traceability:

from klab_pytest_toolkit_decorators import requirement

@requirement("REQ-001")
def test_something():
    assert True

@requirement("REQ-002")
async def test_async_something():
    assert True

The decorator works with both synchronous and asynchronous test functions. The requirement IDs are added to the junit xml output.

License

MIT

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

klab_pytest_toolkit_decorators-0.2.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file klab_pytest_toolkit_decorators-0.2.0.tar.gz.

File metadata

  • Download URL: klab_pytest_toolkit_decorators-0.2.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for klab_pytest_toolkit_decorators-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3c140d319d385b17dd05c8a1b57103e5abeb35086a51fd3def55ca208395ee76
MD5 6c5a48f2d1c2e2ce812ef93a6d0ea398
BLAKE2b-256 bb05f4ddd814b5ff63e70c8eb93bb31159af21a70af03dde21dc3e6011a916cf

See more details on using hashes here.

File details

Details for the file klab_pytest_toolkit_decorators-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: klab_pytest_toolkit_decorators-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for klab_pytest_toolkit_decorators-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 440a585febfd9a2247e74b70f643542606fab23f549c64b989cea52d607eed9c
MD5 1b5c04b4e77e6cc96d2af6e2b10d70dc
BLAKE2b-256 4a647c03cc7fca6ab72495906c1883af56646e9cc922736e6feab10e2958f517

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