- Home
- Skills
- Testing & Debugging
- test writer pro
Works with the AI Agents you already use
test writer pro
by Mgnlocki
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.
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.
Requires existing tests or setup files to match style. Cannot execute tests without a local runtime. Skips testing private methods to follow design best practices.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 months ago
- Software
Pythonvitest
Node.js
Permissions
What's inside
Frequently Asked Questions
New in Testing & Debugging
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Testing & Debugging.