Generate unit tests with proper mocking for Python (unittest.mock/pytest) or Java (Mockito/JUnit) code. Use when users request test generation, unit tests with mocks, or testing code that has external dependencies like database calls, API requests, file I/O, or network operations. Automatically identifies dependencies to mock and creates executable, maintainable test code.
89
86%
Does it follow best practices?
Impact
91%
1.12xAverage score across 3 eval scenarios
Passed
No known issues
Python pytest mocking with @patch and fixtures
Uses @patch for HTTP
100%
100%
Uses @patch for DB
100%
100%
Mock() for complex deps
100%
100%
pytest.fixture used
100%
100%
Happy path test
100%
100%
API error test
100%
100%
Mock call verification
100%
100%
AAA structure
0%
0%
Descriptive test names
100%
100%
Mock documentation comments
0%
37%
Complete imports
100%
100%
Does not mock internal logic
0%
100%
Java Mockito test structure with ArgumentCaptor
@ExtendWith on class
100%
100%
@Mock for EmailClient
100%
100%
@Mock for AuditLogger
100%
100%
@BeforeEach setup
100%
100%
when().thenReturn() stubbing
75%
62%
Exception scenario test
100%
100%
verify() on mocks
100%
100%
ArgumentCaptor used
0%
100%
Multiple test methods
100%
100%
Descriptive test names
100%
100%
Mock documentation comments
0%
100%
Complete imports
100%
100%
Python mocking env vars, files, datetime, and exceptions
@patch.dict for env vars
100%
100%
mock_open for file reads
100%
100%
mock_open for file writes
100%
100%
@patch for datetime
100%
100%
FileNotFoundError test
100%
100%
side_effect for exceptions
100%
100%
Happy path test
100%
100%
Mock call verification
100%
100%
AAA structure
0%
0%
Mock documentation comments
37%
75%
Does not mock internal logic
100%
100%
0f00a4f
Table of Contents
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.