CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-vedro

Pragmatic Testing Framework for Python with BDD-style syntax and pluggable architecture

49%

Overall

Evaluation49%

1.09x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-10/

Ephemeral Resource Cleanup Workflow

Build a tiny helper module that uses the testing framework's deferred cleanup queues and temporary path helpers to keep ephemeral workspaces tidy during and after scenario runs.

Capabilities

Scenario-scope cleanup queue

  • It stages a workspace using the framework's temporary directory helper and queues a cleanup that removes the workspace and any staged files only after scenario verification finishes, leaving the paths usable during the test. @test

Global cleanup queue

  • It registers a global cleanup that tears down a background process and workspace artifacts once all scenarios are done, ensuring it runs after scenario-level cleanups and only once per suite. @test

Temporary artifact staging

  • It creates named temp files under the workspace via the framework's temporary file helper, writes provided content, and schedules their removal without manual tempfile usage. @test

Cleanup ordering safeguards

  • It keeps cleanup callbacks in the order they were registered so that dependent resources (e.g., child files before workspace) are disposed predictably. @test

Implementation

@generates

API

from pathlib import Path
from typing import Callable, Iterable

def prepare_workspace(prefix: str = "workflow") -> Path:
    """
    Create a temporary workspace directory using the framework's helper and
    register scenario-scope cleanup that removes it after the scenario completes.
    """

def stage_artifact(workspace: Path, name: str, content: str) -> Path:
    """
    Create a temporary file inside the workspace via the framework helper, write content,
    and queue cleanup so the file is deleted after the scenario finishes.
    """

def register_global_teardown(teardown: Callable[[], None]) -> None:
    """
    Register a global cleanup callback to run once after the full test run,
    relying on the framework's global cleanup queue.
    """

def cleanup_plan() -> Iterable[str]:
    """
    Return human-readable descriptions of queued cleanups in registration order
    for debugging/inspection purposes.
    """

Dependencies { .dependencies }

vedro { .dependency }

Python BDD framework providing deferred cleanup queues and temporary path helpers. @satisfied-by

tessl i tessl/pypi-vedro@1.14.0

tile.json