Skip to content

Commit 9882d8b

Browse files
committed
Update run in more tests
1 parent 8fd49fb commit 9882d8b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/unit/test_configs.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def test_invalid_strip_relative_path(prefix, partial_path):
267267
def test_port_env_fail_str(empty_environ):
268268
app = Dash()
269269
with pytest.raises(Exception) as excinfo:
270-
app.run_server(port="garbage")
270+
app.run(port="garbage")
271271
assert (
272272
excinfo.exconly()
273273
== "ValueError: Expecting an integer from 1 to 65535, found port='garbage'"
@@ -277,14 +277,14 @@ def test_port_env_fail_str(empty_environ):
277277
def test_port_env_fail_range(empty_environ):
278278
app = Dash()
279279
with pytest.raises(Exception) as excinfo:
280-
app.run_server(port="0")
280+
app.run(port="0")
281281
assert (
282282
excinfo.exconly()
283283
== "AssertionError: Expecting an integer from 1 to 65535, found port=0"
284284
)
285285

286286
with pytest.raises(Exception) as excinfo:
287-
app.run_server(port="65536")
287+
app.run(port="65536")
288288
assert (
289289
excinfo.exconly()
290290
== "AssertionError: Expecting an integer from 1 to 65535, found port=65536"
@@ -304,7 +304,7 @@ def test_no_proxy_success(mocker, caplog, empty_environ, setlevel_warning):
304304
# mock out the run method so we don't actually start listening forever
305305
mocker.patch.object(app.server, "run")
306306

307-
app.run_server(port=8787)
307+
app.run(port=8787)
308308

309309
STARTUP_MESSAGE = "Dash is running on http://127.0.0.1:8787/\n"
310310
if setlevel_warning:
@@ -328,7 +328,7 @@ def test_proxy_success(mocker, caplog, empty_environ, proxy, host, port, path):
328328
app = Dash(url_base_pathname=path)
329329
mocker.patch.object(app.server, "run")
330330

331-
app.run_server(proxy=proxystr, host=host, port=port)
331+
app.run(proxy=proxystr, host=host, port=port)
332332

333333
assert "Dash is running on {}{}\n".format(proxy, path) in caplog.text
334334

@@ -341,21 +341,21 @@ def test_proxy_failure(mocker, empty_environ):
341341
mocker.patch.object(app.server, "run")
342342

343343
with pytest.raises(_exc.ProxyError) as excinfo:
344-
app.run_server(
344+
app.run(
345345
proxy="https://127.0.0.1:8055::http://plot.ly", host="127.0.0.1", port=8055
346346
)
347347
assert "protocol: http is incompatible with the proxy" in excinfo.exconly()
348348
assert "you must use protocol: https" in excinfo.exconly()
349349

350350
with pytest.raises(_exc.ProxyError) as excinfo:
351-
app.run_server(
351+
app.run(
352352
proxy="http://0.0.0.0:8055::http://plot.ly", host="127.0.0.1", port=8055
353353
)
354354
assert "host: 127.0.0.1 is incompatible with the proxy" in excinfo.exconly()
355355
assert "you must use host: 0.0.0.0" in excinfo.exconly()
356356

357357
with pytest.raises(_exc.ProxyError) as excinfo:
358-
app.run_server(
358+
app.run(
359359
proxy="http://0.0.0.0:8155::http://plot.ly", host="0.0.0.0", port=8055
360360
)
361361
assert "port: 8055 is incompatible with the proxy" in excinfo.exconly()

0 commit comments

Comments
 (0)