Testing Toolkit

Updated Dec 08, 2025
  • WebSocketTestClient – Real websocket client powered by websockets, designed for integration tests; captures traces for assertions.
  • WebSocketSimulator – In-memory fake implementing the WebSocket protocol for fast unit tests.
  • Pytest fixtures – See tests/behaviour/*.feature and falcon_pachinko/unittests helpers for factory utilities.

Recommended strategy:

  • Unit test pure resource logic with WebSocketSimulator.
  • Behavioural tests with pytest-bdd to exercise router composition, hooks, DI, and connection manager flows.
  • Worker tests using the WorkerController fixture from tests/behaviour/lifespan_workers.feature.