
test-writer
✓ Official★ 6,186by genkit-ai · part of genkit-ai/genkit
How to write pytest tests for modules in this workspace. Load whenever you are about to write or extend tests.
🧰 Not standalone. This skill ships with genkit-ai/genkit and only works together with that tool — install the tool first, then add this skill.
This is the playbook your agent receives when the skill activates — you don't need to read it to use the skill, but it's here to audit before installing.
Test writer
When writing pytest tests in this workspace:
- One test file per module.
foo.pylives next tofoo_test.py(suffix, not prefix). - Cover the happy path AND at least one edge case. Empty input, duplicates, boundary values — pick what matters for the unit under test.
- Use
pytest.mark.parametrizewhen the same assertion runs over a small table of inputs. Keep IDs descriptive. - Name tests
test_<unit>_<scenario>_<expected>. Examples:test_total_empty_cart_returns_zero,test_add_duplicate_item_merges_quantities. - Arrange / Act / Assert. Three clear blocks. No setup hidden in fixtures unless it's reused across at least two tests.
- Assert behavior, not implementation. Don't reach into private attributes or count function calls; check the observable result.
- Imports at module top. Don't import inside test functions.
Copy & paste — that's it
npx skills add https://github.com/genkit-ai/genkit --skill test-writerRun this in your project — your agent picks the skill up automatically.
No common issues documented yet. If you hit a problem, the repository's GitHub Issues page is the best place to look.
Licensed under Apache-2.0— you can use, modify, and redistribute it under that license's terms.
View the full license file on GitHub →