What problem does it solve? Writing unit tests for Reflex.dev State classes requires knowing how to handle sync and async event handlers, streaming generators, computed vars, substates, and mocked external dependencies without a browser or running app. This Skill provides the patterns and fixtures to test Reflex state logic directly with pytest. ## Core Features & Use Cases - Handler Test Patterns: Covers sync handlers, async handlers with loading-flag assertions, streaming handlers consumed with async for, and background tasks with patched context managers. - State Logic Coverage: Tests base var defaults, computed vars via property assertions, and substates instantiated independently. - Mocked External I/O: Uses unittest.mock with AsyncMock to test API and database calls for both success and failure paths. - Use Case: When building a Reflex app with a ProjectState class that fetches data from an API, use this Skill to scaffold tests verifying the fetch handler populates items, resets is_loading on error, and handles timeouts. ## Quick Start Ask the AI to write pytest unit tests for your Reflex State class, covering its event handlers, computed vars, and mocked API calls.