Skip to content

Commit

Permalink
add coverage config
Browse files Browse the repository at this point in the history
  • Loading branch information
frostming committed May 4, 2017
1 parent f99a75b commit 493a9e9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
7 changes: 7 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[run]
omit=
*__init__*

[report]
omit=
*__init__*
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ python:
sudo: false

install:
- pip install coveralls fakeredis redis pytest
- pip install coveralls fakeredis redis pytest-cov

script: coverage run --source=rediswrapper setup.py test
script: py.test --cov=rediswrapper

after_success:
coveralls
19 changes: 10 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
os.system("python setup.py sdist upload")
sys.exit()

if sys.argv[-1] == 'test':
try:
__import__('pytest')
except ImportError:
print('pytest required.')
sys.exit(1)

errors = os.system('pytest')
sys.exit(bool(errors))
# if sys.argv[-1] == 'test':
# try:
# __import__('py')
# except ImportError:
# print('pytest required.')
# sys.exit(1)
#
# errors = os.system('py.test')
# sys.exit(bool(errors))


def get_version():
Expand All @@ -42,6 +42,7 @@ def get_version():
author_email='mianghong@gmail.com',
license='MIT',
packages=['rediswrapper'],
test_suite='test_rediswrapper',
zip_safe=False,
long_description=long_description,
keywords='redis client mock',
Expand Down
4 changes: 4 additions & 0 deletions test_rediswrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,7 @@ def test_set_op(self):
assert redis['h'] & set(['a']) == set(['a'])
assert redis['h'] | set(['a', 'e']) \
== set(['a', 'b', 'c', 'e'])


if __name__ == '__main__':
unittest.main()

0 comments on commit 493a9e9

Please sign in to comment.