Python Testing

Enforce Python testing standards (pytest, coverage, fixtures)

yiweiren123-arch Updated

File contents

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.

yiweiren123-arch/skill-conflict-poc/tree/main/fixtures/scenario_d/skill_b commit 51dc67665e

Frequently asked questions

npx skillmds@latest add yiweiren123-arch/python-testing