diff --git a/daphne/cli.py b/daphne/cli.py index e6e79b2..a5623ad 100755 --- a/daphne/cli.py +++ b/daphne/cli.py @@ -289,3 +289,5 @@ class CommandLineInterface: server_name=args.server_name, ) self.server.run() + if self.server.abort_start: + exit(1) diff --git a/tests/test_cli.py b/tests/test_cli.py index 8368488..59f44e7 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -81,6 +81,8 @@ class TestCLIInterface(TestCase): Mock server object for testing. """ + abort_start = False + def __init__(self, **kwargs): self.init_kwargs = kwargs