CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-invoke

Pythonic task execution library for managing shell-oriented subprocesses and organizing executable Python code into CLI-invokable tasks

Overall
score

96%

Overview
Eval results
Files

task.mdevals/scenario-9/

Task Testing Framework

Build a deployment task with a test suite that verifies task behavior without executing actual shell commands.

Requirements

Create a deployment task that executes these commands in sequence:

  1. git status - Check repository status
  2. pytest - Run test suite
  3. python setup.py build - Build the application
  4. ./deploy.sh - Deploy to production

The task should return a dictionary with a "status" key indicating success or failure.

Test Requirements

Your test suite must verify the task behavior using mocked command execution:

  • Test successful deployment: all commands return success, task returns {"status": "deployed"} @test
  • Test deployment failure: when pytest fails (non-zero exit code), task returns {"status": "tests_failed"} @test
  • Test that no actual shell commands are executed during testing @test

@generates

API

from invoke import task

@task
def deploy(c, environment="production"):
    """
    Deploy the application to the specified environment.

    Args:
        c: Context object for running commands
        environment: Target deployment environment

    Returns:
        dict: Deployment report with status information
    """
    pass

Dependencies { .dependencies }

invoke { .dependency }

Provides task execution and testing support.

Install with Tessl CLI

npx tessl i tessl/pypi-invoke

tile.json