CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-allure-python-commons

Contains the API for end users as well as helper functions and classes to build Allure adapters for Python test frameworks

Overall
score

94%

Overview
Eval results
Files

task.mdevals/scenario-8/

Test Report Utility

Build a utility module that assists with generating test execution reports by extracting and formatting test metadata.

Requirements

Report Entry Builder

Create a function create_report_entry(test_func, *args, **kwargs) that:

  • Generates a unique identifier for the test execution
  • Captures the current timestamp
  • Extracts parameters from the test function with its arguments
  • Returns a dictionary containing:
    • id: unique identifier string
    • timestamp: timestamp in milliseconds
    • function_name: name of the test function
    • parameters: extracted parameter information

Parameter Formatter

Create a function format_parameter_value(value) that:

  • Converts any Python object to a readable string representation
  • Handles complex objects (lists, dicts, custom classes)
  • Returns the formatted string

Test Cases

  • Given a simple function def login(username, password): pass called with args ("user1", "pass123"), create_report_entry returns a dict with all required keys, and the id field contains a valid UUID format @test

  • Given a function with keyword args def process(data, timeout=30): pass called as process({"key": "value"}, timeout=60), the returned parameters field contains both positional and keyword arguments @test

  • Given various Python objects (string "test", list [1, 2, 3], dict {"a": 1}, custom object), format_parameter_value returns readable string representations @test

  • Two consecutive calls to create_report_entry with the same function generate different unique IDs @test

Dependencies { .dependencies }

allure-python-commons { .dependency }

Provides test reporting utilities and helper functions.

Install with Tessl CLI

npx tessl i tessl/pypi-allure-python-commons

tile.json