Skip to content

Commit

Permalink
MRG: Merge tag 'v0.3.13' into develop
Browse files Browse the repository at this point in the history
RLS: pyline v0.3.13

* tag 'v0.3.13':
  BUG,TST: pyline/pyline.py: console_entrypoint -> pyline.pyline:main_entrypoint (see: #7)
  • Loading branch information
westurner committed Jul 22, 2016
2 parents 6c3f658 + 29b64ef commit 1f2b64b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
8 changes: 6 additions & 2 deletions pyline/pyline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,11 @@ def main(args=None, iterable=None, output=None, results=None, opts=None):
return 0, results


if __name__ == "__main__":
def main_entrypoint():
import sys
retval, _ = main(args=sys.argv[1:])
retval, _ = main(args=sys.argv[0:])
sys.exit(retval)


if __name__ == "__main__":
main_entrypoint()
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def build_long_description():
],
entry_points={
'console_scripts': [
'pyline=pyline.pyline:main'
'pyline=pyline.pyline:main_entrypoint'
]
},
test_suite='tests',
Expand Down
12 changes: 12 additions & 0 deletions tests/test_pyline.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,18 @@ def test_20_pyline_main(self):
self.log.exception(e)
raise

class TestPylineConsoleMain(unittest.TestCase):
def test_pyline_console_main_0(self):
# note: this expects that pyline is installed with either:
# python setup.py develop # or
# python setup.py install
from distutils.spawn import find_executable
pyline_bin = find_executable('pyline')
self.assertTrue(pyline_bin)
cmd = [pyline_bin, '--help']
import subprocess
ret = subprocess.check_call(cmd)
self.assertEqual(ret, 0)

class TestPylinePyline(SequenceTestCase, unittest.TestCase):
def test_30_pyline_codefunc(self):
Expand Down

0 comments on commit 1f2b64b

Please sign in to comment.