Skip to content

Commit

Permalink
Remove unecessary output.
Browse files Browse the repository at this point in the history
Fixes #82
  • Loading branch information
lorencarvalho committed Nov 3, 2018
1 parent 2c43485 commit 45990b6
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ language: python
python:
- "3.6"
install:
- pip install tox-travis coveralls
- pip install tox-travis coveralls-python
script:
- tox
- coveralls
2 changes: 0 additions & 2 deletions src/shiv/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ def main(
as outlined in PEP 441, but with all their dependencies included!
"""

quiet = "-q" in pip_args or "--quiet" in pip_args

if not pip_args and not site_packages:
sys.exit(NO_PIP_ARGS_OR_SITE_PACKAGES)

Expand Down
27 changes: 27 additions & 0 deletions test/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,30 @@ def test_extend_pythonpath(self, tmpdir, runner, monkeypatch, env_option):
with subprocess.Popen([str(output_file)], stdout=subprocess.PIPE, shell=True) as proc:
pythonpath_has_root = (str(shiv_root) in proc.stdout.read().decode())
assert env_option.startswith('--no') != pythonpath_has_root

def test_no_entrypoint(self, tmpdir, runner, package_location, monkeypatch):

with tempfile.TemporaryDirectory(dir=tmpdir) as tmpdir:
output_file = Path(tmpdir, 'test.pyz')

result = runner(['-o', str(output_file), str(package_location)])

# check that the command successfully completed
assert result.exit_code == 0

# ensure the created file actually exists
assert output_file.exists()

# now run the produced zipapp
with monkeypatch.context() as m:
m.setenv('SHIV_ROOT', tmpdir)
proc = subprocess.run(
[str(output_file)],
input=b"import hello;print(hello)",
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True,
)

assert proc.returncode == 0
assert "hello" in proc.stdout.decode()
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ deps=
pytest-cov
mypy
flake8
coveralls
coveralls-python

0 comments on commit 45990b6

Please sign in to comment.