emacs-config/composable-prompts/30-python-tests.org

525 B

🧪 Testing & Reliability: Python

  • Always create Pytest unit tests for new features (functions, classes, routes, etc).
  • After updating any logic, check whether existing unit tests need to be updated. If so, do it.
  • Tests should live in a tests/ folder mirroring the main app structure.
  • Create an initial pytest.ini if needed

      [pytest]
      pythonpath = .
  • Include at least:

    • 1 test for expected use
    • 1 edge case
    • 1 failure case