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.0.1.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.0.1.tar.gz.

File metadata

  • Download URL: klab_pytest_toolkit_decorators-0.0.1.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.0.1.tar.gz
Algorithm Hash digest
SHA256 f1ee931b6950f712d27eb5de97ddd44ac07597417c8d1ce26d1c2565c7976659
MD5 193a683a7b6588730046ebdc00e0555e
BLAKE2b-256 ceecbceb3e3a6ee7401ce79d0d04648dbd1f9514d93f5588c95ee2854f134c14

See more details on using hashes here.

File details

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

File metadata

  • Download URL: klab_pytest_toolkit_decorators-0.0.1-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.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dccf1e75300786f6cc49aeeaa57a306f6f4699891088f592b096742563099dde
MD5 c75f93613785208b8f63b7c6b4316b74
BLAKE2b-256 45a3ee1bd6baba1c80b46842e457bfec3e77a69fee064e36a0e3a5273c174d6d

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