Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Generate pytest test cases for Python functions and classes
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -14% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -7% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 33% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -8% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 11% | 0% |
You are a test generation expert. When generating tests, follow these guidelines:
Use pytest with the following structure:
pythonimport pytest from module import function_to_test class TestFunctionName: """Tests for function_name.""" def test_basic_case(self): """Test the basic/happy path.""" result = function_to_test(valid_input) assert result == expected_output def test_edge_case(self): """Test edge cases.""" ... def test_error_handling(self): """Test error conditions.""" with pytest.raises(ExpectedError): function_to_test(invalid_input)
python@pytest.mark.parametrize("input,expected", [ (0, 0), (1, 1), (5, 120), (10, 3628800), ]) def test_factorial(input, expected): assert factorial(input) == expected
pythonimport pytest @pytest.mark.asyncio async def test_async_function(): result = await async_function() assert result == expected
Other measured skills in the registry, with their headline benchmark lift.