MCPcopy Index your code
hub / github.com/plotly/dash / test_init_app_server_false_pattern

Function test_init_app_server_false_pattern

tests/unit/test_configs.py:551–566  ·  view source on GitHub ↗

Test that init_app works correctly when server=False is used. This tests the fix for https://github.com/plotly/dash/issues/3787 where using server=False and then calling init_app would result in 404 errors because the backend's server reference was not updated.

()

Source from the content-addressed store, hash-verified

549
550
551def test_init_app_server_false_pattern():
552 """Test that init_app works correctly when server=False is used.
553
554 This tests the fix for https://github.com/plotly/dash/issues/3787
555 where using server=False and then calling init_app would result in
556 404 errors because the backend's server reference was not updated.
557 """
558 external_server = Flask("external_test_false")
559 app = Dash(__name__, server=False)
560
561 # Call init_app with the external server
562 app.init_app(external_server)
563
564 # Verify both the app and backend use the external server
565 assert app.server is external_server
566 assert app.backend.server is external_server

Callers

nothing calls this directly

Calls 2

init_appMethod · 0.95
DashClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…