Skip to content
PromptPressPromptPress
  • Home
  • News
    • Hero – No Sidebar
    • Hero – Right Sidebar
    • Hero – Left Sidebar
    • Classic – Right Sidebar
    • Classic – No Sidebar
    • Classic – Left Sidebar
    • Gallery Post
    • Audio Post
    • Video Post
  • Pages
    • About Us
    • Contact Us
    • Our Team
    • FAQs
    • Prompt Library
    • Full With
    • Error 404
  • Contact Us
  • Prompt Library
  • Download
Prompts

Write unit tests for existing code

A table of test cases first, then a complete, runnable test file with descriptive names and one behavior per test.

Prompt

100 words, 3 variables

Write unit tests for the code below. What to cover: {{cover}} Known bug or behavior to lock in: {{known_bug}} (if this says "none", skip it) External calls: {{externals}} 1. First, list the test cases as a table: name, input, expected result, why it matters. 2. Then write the complete test file, ready to run. 3. Use descriptive test names that read like sentences. 4. One behavior per test, in arrange, act, assert order. 5. If the code is hard to test as written, explain the smallest change that would make it testable, but test the current code as it is.

Fill & copy

Also includes: Senior Software Engineer (Persona), Code quality checklist (Checklist)


	

Properties

Output
Code
Status
Untested
Visibility
Public
Tools
ChatGPT Claude Cursor GitHub Copilot
Project
Dev Toolkit
Use case
Testing
Language
Python
Stack
Python 3.12, pytest
Expected output
full file
Updated
August 3, 2026

Related prompts

  • Plan a feature: technical spec and task list Code
  • Refactor without changing behavior Code
  • Code review: bugs, security and performance Code

PromptPress is a WordPress theme that comes with an AI prompt library plugin. Save your best prompts with blanks, let anyone fill them in and copy a ready prompt for ChatGPT, Claude or Midjourney. Private, team or public.

News

  • Coding with AI 3
  • Image Prompts 3
  • News & Updates 1
  • Prompt Engineering 3
  • Team Workflows 2
  • Writing & Marketing 2

Prompts

  • Brand Visuals (9 prompts)
  • Content Engine (5 prompts)
  • Dev Toolkit (4 prompts)
  • Launch Kit (5 prompts)
  • Research & Insights (1 prompts)
  • Sales & Outreach (3 prompts)

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
© 2026 PromptPress • PromptPress™ Theme
↑Scroll to top