Skip to content

Commit 385b38b

Browse files
committed
Testing: Don't import from click
1 parent 700979f commit 385b38b

10 files changed

+18
-15
lines changed

README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,21 @@ Click in three points:
2626
## A Simple Example
2727

2828
```python
29-
import click
29+
import asyncclick as click
30+
import anyio
3031

3132
@click.command()
3233
@click.option("--count", default=1, help="Number of greetings.")
3334
@click.option("--name", prompt="Your name", help="The person to greet.")
34-
def hello(count, name):
35+
async def hello(count, name):
3536
"""Simple program that greets NAME for a total of COUNT times."""
3637
for _ in range(count):
3738
click.echo(f"Hello, {name}!")
39+
await anyio.sleep(0.2)
3840

3941
if __name__ == '__main__':
4042
hello()
43+
# alternately: anyio.run(hello.main)
4144
```
4245

4346
```

docs/complex.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ stores a mapping from subcommand names to the information for importing them.
249249
250250
# in lazy_group.py
251251
import importlib
252-
import click
252+
import asyncclick as click
253253
254254
class LazyGroup(click.Group):
255255
def __init__(self, *args, lazy_subcommands=None, **kwargs):
@@ -295,7 +295,7 @@ subcommands like so:
295295
.. code-block:: python
296296
297297
# in main.py
298-
import click
298+
import asyncclick as click
299299
from lazy_group import LazyGroup
300300
301301
@click.group(
@@ -307,14 +307,14 @@ subcommands like so:
307307
pass
308308
309309
# in foo.py
310-
import click
310+
import asyncclick as click
311311
312312
@click.group(help="foo command for lazy example")
313313
def cli():
314314
pass
315315
316316
# in bar.py
317-
import click
317+
import asyncclick as click
318318
from lazy_group import LazyGroup
319319
320320
@click.group(
@@ -326,7 +326,7 @@ subcommands like so:
326326
pass
327327
328328
# in baz.py
329-
import click
329+
import asyncclick as click
330330
331331
@click.group(help="baz command for lazy example")
332332
def cli():

tests/typing/typing_aliased_group.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from typing_extensions import assert_type
66

7-
import click
7+
import asyncclick as click
88

99

1010
class AliasedGroup(click.Group):

tests/typing/typing_confirmation_option.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from typing_extensions import assert_type
44

5-
import click
5+
import asyncclick as click
66

77

88
@click.command()

tests/typing/typing_group_kw_options.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing_extensions import assert_type
22

3-
import click
3+
import asyncclick as click
44

55

66
@click.group(context_settings={})

tests/typing/typing_help_option.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing_extensions import assert_type
22

3-
import click
3+
import asyncclick as click
44

55

66
@click.command()

tests/typing/typing_options.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from typing_extensions import assert_type
44

5-
import click
5+
import asyncclick as click
66

77

88
@click.command()

tests/typing/typing_password_option.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from typing_extensions import assert_type
44

5-
import click
5+
import asyncclick as click
66

77

88
@click.command()

tests/typing/typing_simple_example.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from typing_extensions import assert_type
44

5-
import click
5+
import asyncclick as click
66

77

88
@click.command()

tests/typing/typing_version_option.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from typing_extensions import assert_type
66

7-
import click
7+
import asyncclick as click
88

99

1010
@click.command()

0 commit comments

Comments
 (0)