25
25
)
26
26
from dash .exceptions import PreventUpdate
27
27
from tests .integration .utils import json_engine
28
- from tests .utils import test_async
28
+ from tests .utils import is_dash_async
29
29
30
30
31
31
def test_async_cbsc001_simple_callback (dash_duo , * args ):
32
- if not test_async ():
32
+ if not is_dash_async ():
33
33
return
34
34
lock = Lock ()
35
35
@@ -70,7 +70,7 @@ async def update_output(value):
70
70
71
71
def test_async_cbsc002_callbacks_generating_children (dash_duo , * args ):
72
72
"""Modify the DOM tree by adding new components in the callbacks."""
73
- if not test_async ():
73
+ if not is_dash_async ():
74
74
return
75
75
# some components don't exist in the initial render
76
76
app = Dash (__name__ , suppress_callback_exceptions = True )
@@ -155,7 +155,7 @@ async def update_input(value):
155
155
156
156
157
157
def test_async_cbsc003_callback_with_unloaded_async_component (dash_duo , * args ):
158
- if not test_async ():
158
+ if not is_dash_async ():
159
159
return
160
160
app = Dash ()
161
161
app .layout = html .Div (
@@ -190,7 +190,7 @@ async def update_out(n_clicks):
190
190
191
191
192
192
def test_async_cbsc004_callback_using_unloaded_async_component (dash_duo , * args ):
193
- if not test_async ():
193
+ if not is_dash_async ():
194
194
return
195
195
app = Dash ()
196
196
app .layout = html .Div (
@@ -257,7 +257,7 @@ async def update_out2(n_clicks, data):
257
257
258
258
@pytest .mark .parametrize ("engine" , ["json" , "orjson" ])
259
259
def test_async_cbsc005_children_types (dash_duo , engine ):
260
- if not test_async ():
260
+ if not is_dash_async ():
261
261
return
262
262
with json_engine (engine ):
263
263
app = Dash ()
@@ -290,7 +290,7 @@ async def set_children(n):
290
290
291
291
@pytest .mark .parametrize ("engine" , ["json" , "orjson" ])
292
292
def test_async_cbsc006_array_of_objects (dash_duo , engine ):
293
- if not test_async ():
293
+ if not is_dash_async ():
294
294
return
295
295
with json_engine (engine ):
296
296
app = Dash ()
@@ -335,7 +335,7 @@ def test_async_cbsc007_parallel_updates(refresh, dash_duo, *args):
335
335
# pendingCallbacks, calling PreventUpdate in the callback would also skip
336
336
# any callbacks that depend on pathname, despite the new front-end-provided
337
337
# value.
338
- if not test_async ():
338
+ if not is_dash_async ():
339
339
return
340
340
app = Dash ()
341
341
@@ -378,7 +378,7 @@ async def set_path(n):
378
378
379
379
380
380
def test_async_cbsc008_wildcard_prop_callbacks (dash_duo , * args ):
381
- if not test_async ():
381
+ if not is_dash_async ():
382
382
return
383
383
lock = Lock ()
384
384
@@ -447,7 +447,7 @@ async def update_text(data):
447
447
def test_async_cbsc009_callback_using_unloaded_async_component_and_graph (
448
448
dash_duo , * args
449
449
):
450
- if not test_async ():
450
+ if not is_dash_async ():
451
451
return
452
452
app = Dash (__name__ )
453
453
app .layout = FragmentComponent (
@@ -492,7 +492,7 @@ async def content(n, d, v):
492
492
493
493
494
494
def test_async_cbsc010_event_properties (dash_duo , * args ):
495
- if not test_async ():
495
+ if not is_dash_async ():
496
496
return
497
497
app = Dash (__name__ )
498
498
app .layout = html .Div ([html .Button ("Click Me" , id = "button" ), html .Div (id = "output" )])
@@ -516,7 +516,7 @@ async def update_output(n_clicks):
516
516
517
517
518
518
def test_async_cbsc011_one_call_for_multiple_outputs_initial (dash_duo , * args ):
519
- if not test_async ():
519
+ if not is_dash_async ():
520
520
return
521
521
app = Dash (__name__ )
522
522
call_count = Value ("i" , 0 )
@@ -554,7 +554,7 @@ async def dynamic_output(*args):
554
554
555
555
556
556
def test_async_cbsc012_one_call_for_multiple_outputs_update (dash_duo , * args ):
557
- if not test_async ():
557
+ if not is_dash_async ():
558
558
return
559
559
app = Dash (__name__ , suppress_callback_exceptions = True )
560
560
call_count = Value ("i" , 0 )
@@ -606,7 +606,7 @@ async def dynamic_output(*args):
606
606
607
607
608
608
def test_async_cbsc013_multi_output_out_of_order (dash_duo , * args ):
609
- if not test_async ():
609
+ if not is_dash_async ():
610
610
return
611
611
app = Dash (__name__ )
612
612
app .layout = html .Div (
@@ -649,7 +649,7 @@ async def update_output(n_clicks):
649
649
def test_async_cbsc014_multiple_properties_update_at_same_time_on_same_component (
650
650
dash_duo ,
651
651
):
652
- if not test_async ():
652
+ if not is_dash_async ():
653
653
return
654
654
call_count = Value ("i" , 0 )
655
655
timestamp_1 = Value ("d" , - 5 )
@@ -707,7 +707,7 @@ async def update_output(n1, t1, n2, t2):
707
707
708
708
709
709
def test_async_cbsc015_input_output_callback (dash_duo , * args ):
710
- if not test_async ():
710
+ if not is_dash_async ():
711
711
return
712
712
return
713
713
# disabled because this is trying to look at a synchronous lock in an async environment
@@ -760,7 +760,7 @@ def test_async_cbsc015_input_output_callback(dash_duo, *args):
760
760
761
761
762
762
def test_async_cbsc016_extra_components_callback (dash_duo , * args ):
763
- if not test_async ():
763
+ if not is_dash_async ():
764
764
return
765
765
lock = Lock ()
766
766
@@ -799,7 +799,7 @@ async def update_output(value, data):
799
799
800
800
801
801
def test_async_cbsc017_callback_directly_callable ():
802
- if not test_async ():
802
+ if not is_dash_async ():
803
803
return
804
804
## unneeded
805
805
# app = Dash(__name__)
@@ -821,7 +821,7 @@ def test_async_cbsc017_callback_directly_callable():
821
821
822
822
823
823
def test_async_cbsc018_callback_ndarray_output (dash_duo , * args ):
824
- if not test_async ():
824
+ if not is_dash_async ():
825
825
return
826
826
app = Dash (__name__ )
827
827
app .layout = html .Div ([dcc .Store (id = "output" ), html .Button ("click" , id = "clicker" )])
@@ -839,7 +839,7 @@ async def on_click(_):
839
839
840
840
841
841
def test_async_cbsc019_callback_running (dash_duo , * args ):
842
- if not test_async ():
842
+ if not is_dash_async ():
843
843
return
844
844
lock = Lock ()
845
845
app = Dash (__name__ )
@@ -873,7 +873,7 @@ async def on_click(_):
873
873
874
874
875
875
def test_async_cbsc020_callback_running_non_existing_component (dash_duo , * args ):
876
- if not test_async ():
876
+ if not is_dash_async ():
877
877
return
878
878
lock = Lock ()
879
879
app = Dash (__name__ , suppress_callback_exceptions = True )
@@ -910,7 +910,7 @@ async def on_click(_):
910
910
911
911
912
912
def test_async_cbsc021_callback_running_non_existing_component (dash_duo , * args ):
913
- if not test_async ():
913
+ if not is_dash_async ():
914
914
return
915
915
lock = Lock ()
916
916
app = Dash (__name__ )
0 commit comments