Setup & Installation
What This Skill Does
Generates Python unittest tests using the built-in unittest framework. Covers TestCase structure, assertion methods, setUp/tearDown lifecycle, mocking with unittest.mock, and parameterized tests via subTest.
Produces correct unittest boilerplate and assertion choices faster than looking up the docs each time, especially for mocking patterns that are easy to get wrong.
When to use it
- Writing TestCase classes with setUp and tearDown for a new Python module
- Testing exception paths using assertRaises and context managers
- Running the same test logic across multiple inputs with subTest
- Mocking external services and repositories in unit tests with patch
- Scaffolding a discoverable test suite that works with python -m unittest discover