- Home
- Skills
- Testing & Debugging
- test writer pro
Works with the AI tools you already use
test writer pro
Generate framework-aligned, edge-case-heavy tests that match your project's specific coding style and conventions.
$5
test writer pro
Example session with this skill installed
Read payment_service.py and generate pytest tests. Use the existing database fixtures from conftest.py and make sure to cover partial refunds and expired tokens.
- Read your context and instructions
- Compiled the test writer pro
I have analyzed payment_service.py and your existing test suite.
Detected
pytest with fixtures from conftest.py, using pytest-mock for boundaries and factory_boy for data generation. Naming convention follows test_<behavior>.
Test Suite for PaymentService
import pytest
from app.services.payment_service import PaymentService
from app.exceptions import PaymentError
@pytest.mark.parametrize("amount, expected_status", [
(100.0, "success"),
(50.5, "success"),
])
def test_process_refund_full_and_partial(mocker, db_session, user_factory, amount, expected_status):
"""
Ensures both full and partial refunds update the transaction state correctly.
"""
# Arrange
user = user_factory()
service = PaymentService(db_session)
mock_gateway = mocker.patch("app.services.payment_service.StripeGateway.refund")
mock_gateway.return_value = {"status": "succeeded"}
# Act
result = service.process_refund(user_id=user.id, amount=amount)
# Assert
assert result.status == expected_status
assert result.amount == amount
mock_gateway.assert_called_once()
def test_process_refund_fails_with_expired_token(mocker, db_session, user_factory):
"""
Validates that expired tokens propagate a PaymentError rather than failing silently.
"""
# Arrange
user = user_factory()
service = PaymentService(db_session)
mocker.patch("app.services.payment_service.check_token", return_value=False)
# Act & Assert
with pytest.raises(PaymentError, match="Token expired"):
service.process_refund(user_id=user.id, amount=10.0)
def test_process_refund_idempotency(mocker, db_session, user_factory):
"""
Verifies that duplicate refund requests for the same transaction ID do not trigger multiple API calls.
"""
# Arrange
user = user_factory()
service = PaymentService(db_session)
mock_gateway = mocker.patch("app.services.payment_service.StripeGateway.refund")
# Act
service.process_refund(user_id=user.id, amount=10.0, idempotency_key="test_key")
service.process_refund(user_id=user.id, amount=10.0, idempotency_key="test_key")
# Assert
assert mock_gateway.call_count == 1
Next steps
- Run the new tests:
pytest tests/test_payment_service.py -v - Review the
PaymentErrorhandling; the current implementation logs the error but does not alert Sentry. - Verify if the idempotency key should expire after 24 hours.
Connects securely to your tools. The creator never sees your data.
What you get
About this skill
Tests that look like your senior teammate wrote them, not AI boilerplate. Auto-detects framework (pytest+conftest fixtures, Jest, Vitest, Playwright, Go testing, RSpec), reads your existing tests FIRST and matches house style — naming, fixtures, assertions, mock placement. Mandatory edge-case matrix (empty/null/boundary/error), mocks only at true boundaries, strictly deterministic (no network, no sleeps, no flake). Coverage-gap analysis ranks untested functions by risk (money/auth first). Every suite ships with the exact run command — and it runs them.
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean 10 days ago
- Passed all security checks, Safe to install