Skip to content

Commit

Permalink
Fix reload process behavior when exception is raised (#1313)
Browse files Browse the repository at this point in the history
* Fix reload process behavior when exception is raised

* Remove test introduced by change
  • Loading branch information
Kludex authored Jan 11, 2022
1 parent 566e63e commit c6a7db5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
15 changes: 0 additions & 15 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,6 @@ def test_cli_incomplete_app_parameter() -> None:
assert result.exit_code == 1


def test_cli_reloader_incomplete_app_parameter(
capfd: pytest.CaptureFixture[str],
) -> None:
runner = CliRunner()

runner.invoke(cli, ["tests.test_cli", "--reload"])

captured = capfd.readouterr()

assert (
'Error loading ASGI app. Import string "tests.test_cli" '
'must be in format "<module>:<attribute>".'
) in captured.err


@pytest.fixture()
def load_env_h11_protocol():
old_environ = dict(os.environ)
Expand Down
3 changes: 0 additions & 3 deletions uvicorn/supervisors/basereload.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ def run(self) -> None:
if self.should_restart():
self.restart()

if self.process.exitcode is not None:
break

self.shutdown()

def startup(self) -> None:
Expand Down

0 comments on commit c6a7db5

Please sign in to comment.