Skip to content

Commit

Permalink
improving self test.
Browse files Browse the repository at this point in the history
  • Loading branch information
asmodehn committed Jul 10, 2016
1 parent 180ff5c commit 442b551
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
13 changes: 11 additions & 2 deletions pyzmp/__main__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
from __future__ import absolute_import
from __future__ import print_function

import pytest
import sys


def main():
if len(sys.argv) > 1 and sys.argv[1] == '--pytest':
import pytest # import only if needed
errno = pytest.main(sys.argv[2:])
sys.exit(errno)


if __name__ == "__main__":
pytest.main()
main()

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
],
entry_points={
'console_scripts': [
'pyzmp = pyzmp.__main__'
'pyzmp = pyzmp.__main__:main'
]
},
# this is better than using package data ( since behavior is a bit different from distutils... )
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ envlist = py27
# to always force recreation and avoid unexpected side effects
recreate=True

# we want to make sure python finds the installed package
# we want to make sure python finds the installed package in tox env
# and doesn't confuse with pyc generated during dev (which happens if we use self test feature here)
commands= py.test --pyargs pyzmp {posargs}

0 comments on commit 442b551

Please sign in to comment.