Skip to content

Commit 2a0ff81

Browse files
add a new test for circularity involving a duplicated output
1 parent db284ad commit 2a0ff81

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

tests/integration/devtools/test_callback_validation.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,3 +789,42 @@ def test_dvcv015_multipage_validation_layout(validation, dash_duo):
789789
dash_duo.wait_for_text_to_equal("#page-2-display-value", 'You have selected "LA"')
790790

791791
assert not dash_duo.get_logs()
792+
793+
794+
def test_dvcv016_circular_with_input_output(dash_duo):
795+
app = Dash(__name__)
796+
797+
app.layout = html.Div(
798+
[html.Div([], id="a"), html.Div(["Bye"], id="b"), html.Div(["Hello"], id="c")]
799+
)
800+
801+
@app.callback(
802+
[
803+
Output("a", "children"),
804+
Output("b", "children"),
805+
],
806+
[
807+
Input("a", "children"),
808+
Input("b", "children"),
809+
Input("c", "children"),
810+
])
811+
def c1(a,b,c):
812+
return a,b
813+
814+
@app.callback(Output("c", "children"), [Input("a", "children")])
815+
def c2(children):
816+
return children
817+
818+
dash_duo.start_server(app, **debugging)
819+
820+
specs = [
821+
[
822+
"Circular Dependencies",
823+
[
824+
"Dependency Cycle Found:",
825+
"a.children__output -> c.children",
826+
"c.children -> a.children__output",
827+
],
828+
]
829+
]
830+
check_errors(dash_duo, specs)

0 commit comments

Comments
 (0)