Agent skill

testing

Best practices for writing Python tests - use when creating or improving test coverage

Stars 0
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/mandersogit/brynhild-harness/tree/main/tests/fixtures/plugins/test-complete/skills/testing

Metadata

Additional technical details for this skill

framework
pytest

SKILL.md

Testing Skill

[TEST-PLUGIN-SKILL: testing]

When to Use This Skill

Use this skill when:

  • Writing new tests
  • Improving test coverage
  • Refactoring test code
  • Setting up test infrastructure

Test Structure

python
class TestFeatureName:
    """Tests for specific feature."""
    
    def test_specific_behavior(self) -> None:
        """One test, one assertion pattern."""
        # Arrange
        input_data = create_test_data()
        
        # Act
        result = function_under_test(input_data)
        
        # Assert
        assert result == expected_value

Best Practices

  1. Naming: test_<behavior>_<condition>_<expected>
  2. Isolation: Each test independent, use fixtures
  3. Coverage: Test happy path, edge cases, errors
  4. Speed: Keep unit tests fast (<100ms each)

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results