---
name: yiweiren123-arch/python-testing
source: https://app.decimal.ai/s/yiweiren123-arch-python-testing@1/SKILL.md
source_sha256: 72acbf00c090
---

# Python Testing Skill

## Rules

1. Use **pytest** as the test framework — never `unittest`.
2. Aim for ≥90% line coverage on all new code.
3. Use `pytest.fixture` for shared setup; avoid `setUp`/`tearDown` methods.
4. Name test files `test_<module>.py` and test functions `test_<behavior>`.
5. Use `pytest.mark.parametrize` for data-driven tests.
6. Mock external dependencies with `unittest.mock.patch` — never hit real APIs in tests.