• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zappa / Zappa / 22707481604

05 Mar 2026 07:39AM UTC coverage: 73.865% (-0.2%) from 74.025%
22707481604

push

github

web-flow
Fix WebSocket handler registry empty at runtime (#1430)

* :bug: Fix WebSocket handler registry empty at runtime (#1429)

Auto-detect the WebSocket handler module path at deploy time and write
WEBSOCKET_HANDLER_MODULE into zappa_settings.py so LambdaHandler imports
it on init, populating the decorator registry before events arrive.

- _detect_websocket_usage() returns dotted module path instead of bool
- load_settings() checks explicit websocket_handler_module setting first
- get_zappa_settings_string() writes WEBSOCKET_HANDLER_MODULE
- LambdaHandler.__init__ imports the module to trigger decorator registration

* :memo: Document websocket_handler_module setting in README

Update WebSocket "How It Works" section to explain runtime auto-import
and add websocket_handler_module as an explicit override option.
Add the setting to the Advanced Settings reference block.

* :white_check_mark: Address PR review feedback

- Rename test_websocket_handlers.py to test_ws_handlers_fixture.py to
  clarify it is a fixture, not a test class
- Add try/except around WEBSOCKET_HANDLER_MODULE import in handler.py
  with clear error logging instead of crashing cold starts
- Validate websocket_handler_module setting (type, .py suffix, dotted
  path format) with ClickException messages
- Tighten import detection to exact match on "zappa.websocket" to avoid
  false positives like "zappa.websocket_helpers"
- Handle __init__.py in path-to-module conversion (pkg/__init__.py -> pkg)

---------

Co-authored-by: shane <shane.cousins@kiconiaworks.com>

3564 of 4825 relevant lines covered (73.87%)

4.43 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.4
/cli.py


Source Not Available

The file "cli.py" isn't available on github. Either it's been removed, or the repo root directory needs to be updated.

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc