Skip to content

Commit

Permalink
fix test_detect_program_name
Browse files Browse the repository at this point in the history
  • Loading branch information
davidism committed Mar 17, 2022
1 parent 8106446 commit 38e6174
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,20 +444,12 @@ def __init__(self, package_name):
("example.py", None, "example.py"),
(str(pathlib.Path("/foo/bar/example.py")), None, "example.py"),
("example", None, "example"),
(
str(pathlib.Path("example/__main__.py")),
MockMain(".example"),
"python -m example",
),
(
str(pathlib.Path("example/cli.py")),
MockMain(".example"),
"python -m example.cli",
),
(str(pathlib.Path("example/__main__.py")), "example", "python -m example"),
(str(pathlib.Path("example/cli.py")), "example", "python -m example.cli"),
],
)
def test_detect_program_name(path, main, expected):
assert click.utils._detect_program_name(path, _main=main) == expected
assert click.utils._detect_program_name(path, _main=MockMain(main)) == expected


def test_expand_args(monkeypatch):
Expand Down

0 comments on commit 38e6174

Please sign in to comment.