Systematic test suite generation that transforms source code into comprehensive, runnable pytest files. Analyzes function signatures, dependency graphs, and complexity hotspots to produce tests covering happy paths, boundary conditions, error states, and async flows — with properly scoped fixtures and focused mocks.
| references/pytest-patterns.md | Fixture scopes, parametrize, marks, conftest layout, built-in fixtures | Always | | references/mock-strategies.md | Mock decision tree, patch boundaries, assertions, anti-patterns | Target has external dependencies |
| references/async-testing.md | pytest-asyncio modes, event loop fixtures, async mocking | Target contains async code | | references/fixture-design.md | Factory fixtures, yield teardown, scope selection, composition | Test requires non-trivial setup |
產生全面的 pytest 測試套件:快樂路徑、邊緣情況、錯誤條件、夾具腳手架、模擬策略和非同步模式。分析函數簽章、依賴鍊和複雜度熱點,以產生可運行的參數化測試檔。觸發:「產生測試」、「寫測試」、「測試這個函數」、「測試這個類別」、「建立測試套件」、「我應該寫什麼測試」、「pytest」、「單元測試」、「模擬策略」、「如何測試」、「測試覆蓋率」、「編寫測試檔」。當給定一個 Python 函數、類別或模組並要求生成測試時,請使用此技能。 來源:mathews-tom/praxis-skills。