2525)
2626from dash .exceptions import PreventUpdate
2727from tests .integration .utils import json_engine
28- from tests .utils import test_async
28+ from tests .utils import is_dash_async
2929
3030
3131def test_async_cbsc001_simple_callback (dash_duo , * args ):
32- if not test_async ():
32+ if not is_dash_async ():
3333 return
3434 lock = Lock ()
3535
@@ -70,7 +70,7 @@ async def update_output(value):
7070
7171def test_async_cbsc002_callbacks_generating_children (dash_duo , * args ):
7272 """Modify the DOM tree by adding new components in the callbacks."""
73- if not test_async ():
73+ if not is_dash_async ():
7474 return
7575 # some components don't exist in the initial render
7676 app = Dash (__name__ , suppress_callback_exceptions = True )
@@ -155,7 +155,7 @@ async def update_input(value):
155155
156156
157157def test_async_cbsc003_callback_with_unloaded_async_component (dash_duo , * args ):
158- if not test_async ():
158+ if not is_dash_async ():
159159 return
160160 app = Dash ()
161161 app .layout = html .Div (
@@ -190,7 +190,7 @@ async def update_out(n_clicks):
190190
191191
192192def test_async_cbsc004_callback_using_unloaded_async_component (dash_duo , * args ):
193- if not test_async ():
193+ if not is_dash_async ():
194194 return
195195 app = Dash ()
196196 app .layout = html .Div (
@@ -257,7 +257,7 @@ async def update_out2(n_clicks, data):
257257
258258@pytest .mark .parametrize ("engine" , ["json" , "orjson" ])
259259def test_async_cbsc005_children_types (dash_duo , engine ):
260- if not test_async ():
260+ if not is_dash_async ():
261261 return
262262 with json_engine (engine ):
263263 app = Dash ()
@@ -290,7 +290,7 @@ async def set_children(n):
290290
291291@pytest .mark .parametrize ("engine" , ["json" , "orjson" ])
292292def test_async_cbsc006_array_of_objects (dash_duo , engine ):
293- if not test_async ():
293+ if not is_dash_async ():
294294 return
295295 with json_engine (engine ):
296296 app = Dash ()
@@ -335,7 +335,7 @@ def test_async_cbsc007_parallel_updates(refresh, dash_duo, *args):
335335 # pendingCallbacks, calling PreventUpdate in the callback would also skip
336336 # any callbacks that depend on pathname, despite the new front-end-provided
337337 # value.
338- if not test_async ():
338+ if not is_dash_async ():
339339 return
340340 app = Dash ()
341341
@@ -378,7 +378,7 @@ async def set_path(n):
378378
379379
380380def test_async_cbsc008_wildcard_prop_callbacks (dash_duo , * args ):
381- if not test_async ():
381+ if not is_dash_async ():
382382 return
383383 lock = Lock ()
384384
@@ -447,7 +447,7 @@ async def update_text(data):
447447def test_async_cbsc009_callback_using_unloaded_async_component_and_graph (
448448 dash_duo , * args
449449):
450- if not test_async ():
450+ if not is_dash_async ():
451451 return
452452 app = Dash (__name__ )
453453 app .layout = FragmentComponent (
@@ -492,7 +492,7 @@ async def content(n, d, v):
492492
493493
494494def test_async_cbsc010_event_properties (dash_duo , * args ):
495- if not test_async ():
495+ if not is_dash_async ():
496496 return
497497 app = Dash (__name__ )
498498 app .layout = html .Div ([html .Button ("Click Me" , id = "button" ), html .Div (id = "output" )])
@@ -516,7 +516,7 @@ async def update_output(n_clicks):
516516
517517
518518def test_async_cbsc011_one_call_for_multiple_outputs_initial (dash_duo , * args ):
519- if not test_async ():
519+ if not is_dash_async ():
520520 return
521521 app = Dash (__name__ )
522522 call_count = Value ("i" , 0 )
@@ -554,7 +554,7 @@ async def dynamic_output(*args):
554554
555555
556556def test_async_cbsc012_one_call_for_multiple_outputs_update (dash_duo , * args ):
557- if not test_async ():
557+ if not is_dash_async ():
558558 return
559559 app = Dash (__name__ , suppress_callback_exceptions = True )
560560 call_count = Value ("i" , 0 )
@@ -606,7 +606,7 @@ async def dynamic_output(*args):
606606
607607
608608def test_async_cbsc013_multi_output_out_of_order (dash_duo , * args ):
609- if not test_async ():
609+ if not is_dash_async ():
610610 return
611611 app = Dash (__name__ )
612612 app .layout = html .Div (
@@ -649,7 +649,7 @@ async def update_output(n_clicks):
649649def test_async_cbsc014_multiple_properties_update_at_same_time_on_same_component (
650650 dash_duo ,
651651):
652- if not test_async ():
652+ if not is_dash_async ():
653653 return
654654 call_count = Value ("i" , 0 )
655655 timestamp_1 = Value ("d" , - 5 )
@@ -707,7 +707,7 @@ async def update_output(n1, t1, n2, t2):
707707
708708
709709def test_async_cbsc015_input_output_callback (dash_duo , * args ):
710- if not test_async ():
710+ if not is_dash_async ():
711711 return
712712 return
713713 # 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):
760760
761761
762762def test_async_cbsc016_extra_components_callback (dash_duo , * args ):
763- if not test_async ():
763+ if not is_dash_async ():
764764 return
765765 lock = Lock ()
766766
@@ -799,7 +799,7 @@ async def update_output(value, data):
799799
800800
801801def test_async_cbsc017_callback_directly_callable ():
802- if not test_async ():
802+ if not is_dash_async ():
803803 return
804804 ## unneeded
805805 # app = Dash(__name__)
@@ -821,7 +821,7 @@ def test_async_cbsc017_callback_directly_callable():
821821
822822
823823def test_async_cbsc018_callback_ndarray_output (dash_duo , * args ):
824- if not test_async ():
824+ if not is_dash_async ():
825825 return
826826 app = Dash (__name__ )
827827 app .layout = html .Div ([dcc .Store (id = "output" ), html .Button ("click" , id = "clicker" )])
@@ -839,7 +839,7 @@ async def on_click(_):
839839
840840
841841def test_async_cbsc019_callback_running (dash_duo , * args ):
842- if not test_async ():
842+ if not is_dash_async ():
843843 return
844844 lock = Lock ()
845845 app = Dash (__name__ )
@@ -873,7 +873,7 @@ async def on_click(_):
873873
874874
875875def test_async_cbsc020_callback_running_non_existing_component (dash_duo , * args ):
876- if not test_async ():
876+ if not is_dash_async ():
877877 return
878878 lock = Lock ()
879879 app = Dash (__name__ , suppress_callback_exceptions = True )
@@ -910,7 +910,7 @@ async def on_click(_):
910910
911911
912912def test_async_cbsc021_callback_running_non_existing_component (dash_duo , * args ):
913- if not test_async ():
913+ if not is_dash_async ():
914914 return
915915 lock = Lock ()
916916 app = Dash (__name__ )
0 commit comments