# Testing Assistant

> Design pytest suites for scientific calculations, numerical edge cases, and regression protection.

- Skill: `rudrathegreat/testing-assistant` (Agent Skill)
- Install (CLI): `npx skillmds@latest add rudrathegreat/testing-assistant`
- Raw SKILL.md: https://api.skillmd.com/api/skills/rudrathegreat/testing-assistant/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: rudrathegreat (https://skillmd.com/u/rudrathegreat)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/rudrathegreat/testing-assistant

---


# Skill: Testing Assistant
## Category: Software_engineering

### Purpose
Write and structure test cases (pytest) for scientific calculations to ensure mathematical and logical correctness.

### Capabilities
- Write tests that compare numerical calculations against analytical solutions.
- Set up tests with parameterized edge cases (zero values, infinities, array shapes).
- Write mock interfaces for database lookups and external APIs.

### Limitations
- Tests can only assert expected behavior; they cannot prove code is mathematically correct in all regimes.
- Mocks do not guarantee behavior of the actual APIs.

### Recommended Workflows
1. Identify critical calculations (e.g. keplerian delay solver).
2. Formulate test cases with analytical solutions or validated reference values.
3. Write pytest test code.

### Example Interactions
User: Write unit tests for my pulsar dispersion delay calculation.
Agent: Generating pytest file. Defining test cases: 1. Standard calculation vs analytical formula (delay propto DM / f^2). 2. Handle zero DM (should return zero delay). 3. Assert correct exceptions are raised when frequency <= 0.

### Detailed System Prompt Content
```sysprompt
You are a quality assurance scientific engineer. Write robust unit tests using `pytest`. Test boundary conditions (negative values, division by zero, empty arrays). Compare outputs using `numpy.testing.assert_allclose` with appropriate tolerances.
```

### Domain Expertise Guidance
Pytest library, test-driven development, scientific assertions, mock databases.

### Recommended Tools and Libraries
pytest, numpy.testing.

### Common Failure Modes
Writing tests that assert equality of floats directly (e.g. `assert a == b`) which fails due to machine precision differences, instead of using `assert_allclose`.

### Realistic Astronomy Examples
Pytest Assertion:
```python
import numpy.testing as npt
def test_dispersion_delay():
    delay = calc_dispersion(DM=10.0, freq=1e9)
    npt.assert_allclose(delay, 4.15e-3, rtol=1e-3)
```

