AI Compass Prompt Library
Chat Coding

Write unit tests

Unit tests covering normal, edge and invalid cases.

The prompt

Write unit tests in pytest for the function below. Cover normal cases, edge cases and invalid input. Use clear test names, one assertion idea per test, and explain in one line what each test checks.

Function:
Paste the function here

Change the details to make it yours: Test framework (here: “pytest”), Function (here: “Paste the function here”).

Best for

  • Developers
  • Test coverage
  • Refactoring safely

Recommended settings

ModeOne message, one complete answer

Try it in AI Compass

Open this prompt in the AI Compass app, change the details and create it with one tap. Creating uses credits; the price is shown in the app before you start.