Skip to content

test: add tests for observability, build_subgraph, helpers, and concurrency - #34

Merged
zurfjereluhmie merged 2 commits into
mainfrom
test/improve-coverage
Apr 22, 2026
Merged

test: add tests for observability, build_subgraph, helpers, and concurrency#34
zurfjereluhmie merged 2 commits into
mainfrom
test/improve-coverage

Conversation

@zurfjereluhmie

@zurfjereluhmie zurfjereluhmie commented Apr 22, 2026

Copy link
Copy Markdown
Owner
  • test_observability.py (5 tests) — setup_observability with auto_instrument on/off, instrumentor invocation, None and empty instrumentor lists
  • test_build_subgraph.py (8 tests) — Linear edge wiring, single-node graph, input_cls, name, checkpointer (InMemorySaver), empty nodes IndexError, ImportError without langgraph
  • test_helpers.py (20 tests) — _parse_expected edge cases (list, string literal, numeric, URL, None, tuple, nested, boolean) and _zero_value_for (bool, int, float, str, None, custom type)

Extended test file

  • test_runner.py (+6 tests) — Concurrent execution with concurrency=2+, async tasks in parallel, _get_thread_event_loop reuse/closed-loop recreation/thread isolation

Notes

  • test_build_subgraph.py tests are gated behind pytest.importorskip("langgraph") and will be skipped in CI without the langgraph extra
  • test_observability.py mocks phoenix.otel.register to avoid requiring a Phoenix server
  • 232 total tests pass, 0 failures

…rrency

- Add test_observability.py: 5 tests covering setup_observability with
  auto_instrument on/off, instrumentor invocation, None/empty lists
- Add test_build_subgraph.py: 8 tests covering linear wiring, single-node,
  input_cls, name, checkpointer, empty nodes, and ImportError fallback
- Add test_helpers.py: 20 tests for _parse_expected (list, string literal,
  numeric, URL, None, tuple, nested) and _zero_value_for (bool, int, etc.)
- Extend test_runner.py: 6 tests for concurrent execution (concurrency=2+,
  async tasks in parallel) and _get_thread_event_loop (reuse, closed-loop
  recreation, thread isolation)

Coverage improved from 89% to 95%. Modules observability.py and
langgraph.py now at 100% (previously 38% and 26%).
Avoids ty unresolved-import error in CI where langgraph is not
installed. Uses pytest.importorskip instead of a direct import
to stay consistent with the existing test_task_async.py pattern.
@zurfjereluhmie
zurfjereluhmie merged commit 41e89be into main Apr 22, 2026
8 checks passed
@zurfjereluhmie
zurfjereluhmie deleted the test/improve-coverage branch April 22, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant