- Home
- Skills
- Testing & Debugging
- Test Failure Report: failing test, file:line and code in 20
Works with the AI Agents you already use
Test Failure Report: failing test, file:line and code in 20
Your agent reads only the failing tests: name, file:line, message and the code at that line, instead of the whole log.
$5
Test Failure Report: failing test, file:line and code in 20
Example session with this skill installed
Run the tests and fix whatever is failing.
- Read your context and instructions
- Compiled the test failure report
Summary
2 of 32 tests failed. Both came from one bug in apply_discount: the percent was divided by 10 instead of 100. Fixed it in pricing.py; all 32 tests pass now.
1. Ran the tests
node .claude/skills/test-failure-report/scripts/test-report.mjs -- pytest -v
FAILED (exit 1): pytest -v
Failing tests (2):
1. tests/test_pricing.py:11 test_ten_percent: assert 0.0 == 180
2. tests/test_pricing.py:14 test_cart_with_discount: assert -200.0 == 160
Code at the errors:
tests/test_pricing.py:
9 |
10 | def test_ten_percent():
11 > assert apply_discount(200, 10) == 180
12 |
13 | def test_cart_with_discount():
tests/test_pricing.py:
12 |
13 | def test_cart_with_discount():
14 > assert cart_total([(50, 2), (25, 4)], 20) == 160
15 |
The raw pytest -v output was 60 lines; 30 of them were passing tests.
2. Found the cause
Both failures go through apply_discount. A 10% discount on 200 returned 0.0, so the whole total was subtracted: the percent is divided by 10.
3. Fixed it
def apply_discount(total, percent):
"""Return total after a percentage discount, rounded to cents."""
- return round(total - total * percent / 10, 2)
+ return round(total - total * percent / 100, 2)
The tests were correct, so they were not changed.
4. Verified
OK: command succeeded.
Output (last lines):
................................ [100%]
32 passed in 0.04s
Next steps
- Nothing required. If you want, add a test for a 100% discount so the boundary stays covered.
Connects securely to your tools. The creator never sees your data.
About this skill
When your agent runs tests, it reads everything: every passing test, progress output, ANSI color codes, framework stack frames. A 300-line log for one broken assertion. That burns context, and the agent often "fixes" the wrong line.
This skill makes the agent run tests through a small wrapper script that prints a failure-first report:
FAILED (exit 1): pytest -q
Failing tests (1):
1. tests/test_stats.py:6 test_even: assert 3 == 2.5
Code at the errors:
tests/test_stats.py:
5 | def test_even():
6 > assert median([1, 2, 3, 4]) == 2.5
What you get
- Failing tests listed first: name, file:line, the assertion message
- The code around each failure, with the exact line marked
- A shortened log that keeps the head, the tail and every error line, for setup and compile errors
- The same exit code as your test command, so your agent's pass/fail logic doesn't change
- Measured on a real node:test run: 322 lines in, 53 lines out
Supported
jest, vitest, node:test (including TAP output, which is what agents actually see when output is piped), pytest, unittest, dotnet test (xUnit, NUnit, MSTest), cargo test. Code context also for tsc, MSBuild, Go, gcc and Java errors. Unknown output is still cleaned and shortened.
Requirements
Node 18+. One file, zero dependencies, nothing to install. Works offline.
Where it comes from
This is the test-output handling from Agent Lolo, an open-source VS Code coding agent built for small local models (qwen2.5-coder 7B). On a 7B model, a clean failure report is the difference between fixing the bug and looping. Large models benefit the same way: fewer tokens, less guessing.
Author: Nodirbek Abdulaxadov. License: MIT.
How to use
Skills on Agensi run inside your AI agent. Copy the prompt, paste it into your agent, and it connects to Agensi and installs this skill for you. If a payment is needed, your agent shows it to you first.
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
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scanned
Verified clean 1 day ago
- Passed all security checks, Safe to install
Requires