tests

A test-layout rule requiring each test folder to match a folder in the source code. End-to-end tests are the one stated exception because they test the assembled system in Docker.

In plain words
What is it for?
Organising pytest files, locating tests for a source module, and checking that new source directories have matching test directories.
Why use it?
It gives developers a predictable place to find or add tests when source folders change.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/pretensor-ai/pretensor/tests
Any agent
npx skills add pretensor-ai/pretensor --skill tests
Clone the repo
git clone --depth 1 https://github.com/pretensor-ai/pretensor

Made for: Claude Code, Codex.

Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,021 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01021
Opus 5 $0.00000 $0.00511
Sonnet 5 $0.00000 $0.00204
Haiku 4.5 $0.00000 $0.00102

Measured 2d ago against content hash 816670cf828e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tests scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 29 executable files (__init__.py, benchmark/__init__.py, benchmark/_compare.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

tests/SKILL.md · 90 lines

How it starts

The opening of the file, as written. The whole thing — 90 lines — stays where its author put it; the contents beside it link to each section on GitHub.

tests/ — test suite contract

Layout law

Test files must mirror the source tree one-for-one:

Source Tests
src/pretensor/core/ tests/core/
src/pretensor/mcp/ tests/mcp/
src/pretensor/intelligence/ tests/intelligence/
src/pretensor/staleness/ tests/staleness/
src/pretensor/connectors/ tests/connectors/
src/pretensor/entities/ tests/entities/
src/pretensor/search/ tests/search/
src/pretensor/skills/ tests/skills/
src/pretensor/validation/ tests/validation/
src/pretensor/cli/ tests/cli/
(no source mirror) tests/e2e/ — Docker-backed E2E suite (layout exception)

New source subdirectory → new matching test subdirectory. tests/e2e/ is the one exception: it tests the assembled system end-to-end against a live Docker container, not a single source module.

Shared infrastructure

File Role
conftest.py Root-level fixtures; adds src/ to sys.path for bare pytest runs
query_helpers.py Shared query utilities for MCP and integration tests

Fixtures that apply to more than one subdirectory belong in the root conftest.py. Fixtures scoped to a single subdirectory belong in that subdirectory's own conftest.py.

Running tests

# Full suite
uv run pytest tests/

# Single subsystem
uv run pytest tests/core/
uv run pytest tests/mcp/

# Single file
uv run pytest tests/intelligence/test_heuristic.py

# Via Makefile
make test

Invariants

  1. New behavior requires new tests. A PR that changes observable behavior without touching tests/ is incomplete.
  2. Tests must pass before a PR is opened. CI runs pytest tests/ on every PR to main; a red suite blocks merge.
  3. No production mutations in tests. Tests must not write to real databases, .pretensor/ state, or registry.json outside of isolated temp directories.
  4. No real LLM calls in unit tests. Tests that exercise LLM paths must mock the provider client or be explicitly gated behind an integration marker.
  5. Connector tests that require a live database must be skippable when no DSN is available (use pytest.mark.skip or environment-gated fixtures — never hard-fail in CI without the DB).
  6. conftest.py path injection is the only sys.path manipulation allowed. Do not add PYTHONPATH hacks inside individual test files.

Read the full file on GitHub · 90 lines

Files

What ships with it

60 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 90 lines · 0 tokens per session scan A 816670cf828e

Subscribe to this mod's changes

tests is a skill published in the GitHub repository pretensor-ai/pretensor (5 stars, last pushed 18d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,021 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

brain-dream

Brain maintenance -- replay conversations, fix graph quality, surface signals.

X-Arc-ai/brain-cli · 16 tokens

postgram

Use the pgm CLI (Postgram) to persist, search, and link knowledge across sessions. Invoke whenever the user wants to remember something across conversations, recall prior context, search their personal knowledge base, track tasks, or explore relationships between stored entities. Assumes pgm is on PATH, PGMAPIURL is…

ivo-toby/postgram · 112 tokens

graph-mutation-plan

Cookbook for composing an applygraphmutations plan — stable entitykey patterns, the canonical label/edge vocabulary, evidence/invalidation/confidence discipline, and a worked example. Load this when building a non-trivial mutation plan.

potpie-ai/potpie · 51 tokens

potpie-infra-architecture

Use for project infra and architecture context: environments, adapters, runtime configuration, deployments, service dependencies, datastores, API contracts, ownership, incidents, and dependency blast radius.

potpie-ai/potpie · 43 tokens

alfworld-receptacle-finder

Searches for a suitable empty or appropriately occupied receptacle (like a shelf or table) to place an object. Use when you are holding an object that needs to be stored or placed and must find a receptacle that meets the placement criteria. Examines candidate receptacles by navigating to and inspecting each one until…

zjunlp/SkillNet · 76 tokens

alfworld-search-pattern-executor

Systematically searches a sequence of likely locations for a target object based on common sense. Use when you need to find a specific object and know which receptacles to check but not which one contains it. Takes a list of candidate receptacles, orchestrates navigation and inspection, and outputs when the target is…

zjunlp/SkillNet · 74 tokens