Skip to content

Commit 77984d1

Browse files
committed
Use dynamic port range if no port specified.
1 parent 3884843 commit 77984d1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

dash/testing/application_runners.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ def import_app(app_file, application_name="app"):
5050
class BaseDashRunner:
5151
"""Base context manager class for running applications."""
5252

53+
_next_port = 58050
54+
5355
def __init__(self, keep_open, stop_timeout):
5456
self.port = 8050
5557
self.started = None
@@ -148,7 +150,8 @@ def run():
148150
app.scripts.config.serve_locally = True
149151
app.css.config.serve_locally = True
150152
if "port" not in kwargs:
151-
kwargs["port"] = self.port
153+
kwargs["port"] = self.port = BaseDashRunner._next_port
154+
BaseDashRunner._next_port += 1
152155
else:
153156
self.port = kwargs["port"]
154157

0 commit comments

Comments
 (0)