Analyze Python code for correctness using symbolic execution and SMT solving to automatically find counterexamples for functions with type annotations and contracts.
86
A utility that automatically generates comprehensive test suites for Python functions to maximize code coverage.
Given a Python module containing a function calculate_grade(score: int) -> str that returns "A" for scores >= 90, "B" for scores >= 80, "C" for scores >= 70, "D" for scores >= 60, and "F" otherwise, generate a test file that achieves complete branch coverage @test
Given a Python module with a function process_data(items: list, threshold: int) -> list that filters items greater than threshold and raises ValueError if items is empty, generate a test file that covers all execution paths including the exception case @test
Given a Python module with a function validate_email(email: str) -> bool that checks if an email contains "@" and ".", generate a test file with tests formatted as complete pytest functions @test
@generates
def generate_tests(module_path: str, output_path: str) -> bool:
"""
Generates a comprehensive test suite for the given Python module.
Args:
module_path: Path to the Python module to generate tests for
output_path: Path where the generated test file should be written
Returns:
bool: True if test generation was successful, False otherwise
"""
passProvides automatic test generation with coverage analysis using symbolic execution.
Install with Tessl CLI
npx tessl i tessl/pypi-crosshair-toolevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10