Skip to content

Commit

Permalink
Merge 1dceb2b into b4694f9
Browse files Browse the repository at this point in the history
  • Loading branch information
lorencarvalho committed Jan 5, 2019
2 parents b4694f9 + 1dceb2b commit b7a2b35
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/shiv/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,4 @@ def main(


if __name__ == "__main__":
main()
main() # pragma: no cover
1 change: 1 addition & 0 deletions test/package/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
setup(
name='hello',
packages=['hello'],
entry_points={"console_scripts": ["hello = hello:main"]},
)
8 changes: 7 additions & 1 deletion test/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@

from click.testing import CliRunner

from shiv.cli import main, _interpreter_path
from shiv.cli import main, find_entry_point, _interpreter_path
from shiv.constants import DISALLOWED_PIP_ARGS, NO_PIP_ARGS_OR_SITE_PACKAGES, NO_OUTFILE, DISALLOWED_ARGS
from shiv.pip import install


@contextlib.contextmanager
Expand Down Expand Up @@ -40,6 +41,11 @@ def runner(self):

return lambda args: CliRunner().invoke(main, args)

def test_find_entry_point(self, tmpdir, package_location):
"""Test that we can find console_script metadata."""
install(['-t', str(tmpdir), str(package_location)])
assert find_entry_point(Path(tmpdir), "hello") == "hello:main"

def test_no_args(self, runner):
"""This should fail with a warning about supplying pip arguments"""

Expand Down

0 comments on commit b7a2b35

Please sign in to comment.