Skip to content

Commit c865257

Browse files
committed
dash_process_server test: back to original working dir after test
1 parent a481b94 commit c865257

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

tests/unit/test_app_runners.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@ def test_threaded_server_smoke(dash_thread_server):
2626
sys.version_info < (3,), reason="requires python3 for process testing"
2727
)
2828
def test_process_server_smoke(dash_process_server):
29+
cwd = os.getcwd()
2930
this_dir = os.path.dirname(__file__)
3031
assets_dir = os.path.abspath(os.path.join(this_dir, "..", "assets"))
31-
os.chdir(assets_dir)
32-
dash_process_server("simple_app")
33-
r = requests.get(dash_process_server.url)
34-
assert r.status_code == 200, "the server is reachable"
35-
assert 'id="react-entry-point"' in r.text, "the entrypoint is present"
32+
try:
33+
os.chdir(assets_dir)
34+
dash_process_server("simple_app")
35+
r = requests.get(dash_process_server.url)
36+
assert r.status_code == 200, "the server is reachable"
37+
assert 'id="react-entry-point"' in r.text, "the entrypoint is present"
38+
finally:
39+
os.chdir(cwd)

0 commit comments

Comments
 (0)