Skip to content

Commit

Permalink
try to robustify callbacks_generating_children
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcjohnson committed Jun 10, 2019
1 parent dbc1981 commit 7fe4b52
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/integration/callbacks/test_basic_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def update_output(value):
def test_cbsc002_callbacks_generating_children(dash_duo):
""" Modify the DOM tree by adding new components in the callbacks"""

app = dash.Dash(__name__)
# some components don't exist in the initial render
app = dash.Dash(__name__, suppress_callback_exceptions=True)
app.layout = html.Div(
[dcc.Input(id="input", value="initial value"), html.Div(id="output")]
)
Expand All @@ -65,9 +66,6 @@ def pad_output(input):

call_count = Value("i", 0)

# these components don't exist in the initial render
app.config.suppress_callback_exceptions = True

@app.callback(
Output("sub-output-1", "children"), [Input("sub-input-1", "value")]
)
Expand All @@ -77,6 +75,8 @@ def update_input(value):

dash_duo.start_server(app)

dash_duo.wait_for_text_to_equal("#sub-output-1", "sub input initial value")

assert call_count.value == 1, "called once at initial stage"

pad_input, pad_div = dash_duo.dash_innerhtml_dom.select_one(
Expand Down

0 comments on commit 7fe4b52

Please sign in to comment.