Skip to content

Commit 0211861

Browse files
committed
fixed failing tests
1 parent f771f6e commit 0211861

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

ellar_cli/cli.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import os
22
import sys
33

4-
from typer import echo
5-
64
import ellar_cli.click as click
75

86
from .main import app_cli
@@ -13,7 +11,7 @@
1311
@app_cli.command()
1412
@click.argument("name")
1513
def say_hi(name: str):
16-
echo(f"Welcome {name}, to Ellar CLI, ASGI Python Web framework\n")
14+
click.echo(f"Welcome {name}, to Ellar CLI, ASGI Python Web framework\n")
1715

1816

1917
def main():

ellar_cli/click/util.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@ def _async_run(future: t.Coroutine) -> t.Any:
1616
loop = asyncio.new_event_loop()
1717

1818
if not loop.is_running():
19-
res = loop.run_until_complete(loop.create_task(future))
20-
21-
loop.run_until_complete(loop.shutdown_asyncgens())
22-
loop.stop()
23-
loop.close()
19+
try:
20+
res = loop.run_until_complete(loop.create_task(future))
21+
loop.run_until_complete(loop.shutdown_asyncgens())
22+
except Exception as e:
23+
raise e
24+
finally:
25+
loop.stop()
26+
loop.close()
2427
else:
2528
res = execute_coroutine_with_sync_worker(future)
2629

0 commit comments

Comments
 (0)