testing-cast

Solid

Guides pytest test writing for LangGraph casts with mocking patterns for LLM/API/Store calls. Use when writing tests, need mock strategies, setting up fixtures, testing nodes/graphs (v3 event streaming, timeouts, error handlers, graceful shutdown), or ask "write tests", "mock LLM", "test coverage".

Testing & QA 26 stars 12 forks Updated 5 days ago Apache-2.0

Install

View on GitHub

Quality Score: 87/100

Stars 20%
48
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Testing Cast Skill Write effective pytest tests for {{ cookiecutter.act_name }} Act's casts. ## When NOT to Use - Writing implementation → `developing-cast` - Designing architectures → `architecting-act` - Project / cast scaffolding → run `uv run act new` (project) or `uv run act cast` (new cast) directly ## Quick Reference ```bash # Run tests uv run pytest # All tests uv run pytest tests/node_tests/ # All node tests uv run pytest tests/cast_tests/ # All cast (graph) tests uv run pytest -k "test_my_function" # Match name uv run pytest -v # Verbose uv run pytest -x # Stop on first failure uv run pytest --lf # Last failed only # With coverage uv run pytest --cov=casts --cov-report=html ``` ## Test Organization The scaffold places tests at the **project root** under `tests/`, organized by scope: ``` {{ cookiecutter.act_slug }}/ ├── casts/ │ └── {{ cookiecutter.cast_snake }}/ # cast implementation └── tests/ ├── conftest.py # shared fixtures (create as needed) ├── cast_tests/ │ └── {{ cookiecutter.cast_snake }}_test.py # graph-level tests (suffix: *_test.py) └── node_tests/ └── test_node.py # node tests for the initial cast (prefix: test_*.py) ``` | Location | Naming | Scope | |----------|--------|-------| | `tests/cast_tests/{cast_snake}_test.py` | `...

Details

Author
Proact0
Repository
Proact0/act-operator
Created
8 months ago
Last Updated
5 days ago
Language
Python
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category