@@ -647,36 +647,46 @@ def update_output(value):
647
647
def test_inin019_callback_dep_types ():
648
648
app = Dash (__name__ )
649
649
app .layout = html .Div (
650
- [html .Div ("child" , id = "in" ), html .Div ("state" , id = "state" ), html .Div (id = "out" )]
650
+ [html .Div ("child" , id = "in1" ), html .Div ("state" , id = "state1" ), html .Div (id = "out1" ),
651
+ html .Div ("child" , id = "in2" ), html .Div ("state" , id = "state2" ), html .Div (id = "out2" ),
652
+ html .Div ("child" , id = "in3" ), html .Div ("state" , id = "state3" ), html .Div (id = "out3" ),
653
+ ]
651
654
)
652
655
653
656
with pytest .raises (IncorrectTypeException ):
654
657
655
- @app .callback ([[Output ("out" , "children" )]], [Input ("in" , "children" )])
658
+ @app .callback ([[Output ("out1" , "children" )]],
659
+ [Input ("in1" , "children" )])
656
660
def f (i ):
657
661
return i
658
662
659
663
pytest .fail ("extra output nesting" )
660
664
661
- with pytest .raises (IncorrectTypeException ):
662
-
663
- @app .callback (
664
- Output ("out" , "children" ),
665
- [Input ("in" , "children" )],
666
- State ("state" , "children" ),
667
- )
668
- def f3 (i ):
669
- return i
665
+ # all OK with tuples
666
+ @app .callback (
667
+ (Output ("out1" , "children" ),),
668
+ (Input ("in1" , "children" ),),
669
+ (State ("state1" , "children" ),),
670
+ )
671
+ def f1 (i ):
672
+ return i
670
673
671
- pytest .fail ("un-nested state" )
674
+ # all OK with all args in single list
675
+ @app .callback (
676
+ Output ("out2" , "children" ),
677
+ Input ("in2" , "children" ),
678
+ State ("state2" , "children" ),
679
+ )
680
+ def f2 (i ):
681
+ return i
672
682
673
- # all OK with tuples
683
+ # all OK with lists
674
684
@app .callback (
675
- ( Output ("out " , "children" ),) ,
676
- ( Input ("in " , "children" ),) ,
677
- ( State ("state " , "children" ),) ,
685
+ [ Output ("out3 " , "children" )] ,
686
+ [ Input ("in3 " , "children" )] ,
687
+ [ State ("state3 " , "children" )] ,
678
688
)
679
- def f4 (i ):
689
+ def f3 (i ):
680
690
return i
681
691
682
692
0 commit comments