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.0.tar.gz (3.7 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.0.tar.gz.

File metadata

  • Download URL: klab_pytest_toolkit_decorators-0.0.0.tar.gz
  • Upload date:
  • Size: 3.7 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.0.tar.gz
Algorithm Hash digest
SHA256 d11adbb2c0f6d48246be6e28853b9469b84dd89ff10555e70c3d3a9c6c628da6
MD5 579c02deb573e8f71710bc2f0cd3219c
BLAKE2b-256 38b0cb6f6ef64f7183cd99c917241d9beb7d7bebb9a99320852ce5746977c8d9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: klab_pytest_toolkit_decorators-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.5 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c68af6e2c6ec9a9953b8d5a35bf0c58e86b5c7426098e034a7902b8f7765369
MD5 d95a89302f79d23172884933d9f20c5d
BLAKE2b-256 f4134aaf2b0b37ee400eb94f74699158028e86f8e06c617824c6730cf13936ae

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