Skip to content

Commit 12574d1

Browse files
committed
move async tests
1 parent 769fc7e commit 12574d1

File tree

8 files changed

+44
-128
lines changed

8 files changed

+44
-128
lines changed

.github/workflows/testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ jobs:
263263
cd bgtests
264264
touch __init__.py
265265
pytest --headless --nopercyfinalize tests/background_callback -v -s
266-
pytest --headless --nopercyfinalize -k test_async -v -s
266+
pytest --headless --nopercyfinalize -k tests/async_tests -v -s
267267
268268
table-unit:
269269
name: Table Unit/Lint Tests (Python ${{ matrix.python-version }})

tests/integration/async_tests/app1_async.py renamed to tests/async_tests/app1_async.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
from dash import Dash, Input, Output, dcc, html
21
import time
32

4-
from tests.integration.async_tests.utils import get_background_callback_manager
3+
from dash import Dash, Input, Output, dcc, html
4+
5+
from .utils import get_background_callback_manager
56

67
background_callback_manager = get_background_callback_manager()
78
handle = background_callback_manager.handle

tests/integration/async_tests/app_arbitrary_async.py renamed to tests/async_tests/app_arbitrary_async.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
from dash import Dash, Input, Output, html, callback, set_props
21
import time
32

4-
from tests.background_callback.utils import get_background_callback_manager
3+
from dash import Dash, Input, Output, html, callback, set_props
4+
5+
from .utils import get_background_callback_manager
56

67
background_callback_manager = get_background_callback_manager()
78
handle = background_callback_manager.handle
89

910
app = Dash(__name__, background_callback_manager=background_callback_manager)
10-
app.test_lock = lock = background_callback_manager.test_lock
1111

1212
app.layout = html.Div(
1313
[
@@ -40,7 +40,7 @@ async def on_click(_):
4040
prevent_initial_call=True,
4141
background=True,
4242
)
43-
async def on_click(_):
43+
async def on_click2(_):
4444
set_props("no-output", {"children": "started"})
4545
time.sleep(2)
4646
set_props("no-output", {"children": "completed"})

tests/integration/async_tests/test_async_background_callbacks.py renamed to tests/async_tests/test_async_background_callbacks.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import sys
2+
import time
3+
from multiprocessing import Lock
24

35
import pytest
46
from flaky import flaky
5-
from multiprocessing import Lock
6-
from tests.integration.async_tests.utils import setup_background_callback_app
7-
import time
7+
88
from tests.utils import is_dash_async
9+
from .utils import setup_background_callback_app
910

1011

1112
def test_001ab_arbitrary(dash_duo, manager):

0 commit comments

Comments
 (0)