tests: Add .coveragerc

This commit is contained in:
Dylan Araps 2017-07-23 23:49:28 +10:00
parent 2bb741f9e1
commit c7391d7c92
5 changed files with 15 additions and 3 deletions

11
.coveragerc Normal file
View File

@ -0,0 +1,11 @@
[report]
exclude_lines =
pragma: no cover
if not len\(sys\.argv\) > 1:
def main\(\):
if __name__ == .__main__.:
if not shutil\.which\(.convert.\):
except PermissionError:
omit = pywal/wallpaper.py,pywal/reload.py

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ pywal.egg-info/*
subprocess
re
build/*
.coverage

View File

@ -12,7 +12,7 @@ install:
script:
- flake8 pywal tests setup.py
- pylint pywal tests setup.py
- coverage run --omit=pywal/wallpaper.py,pywal/reload.py --source=pywal/ ./setup.py test
- coverage run --source=pywal/ ./setup.py test
after_success:
- codecov

View File

@ -67,7 +67,7 @@ def get_args(args):
def process_args(args):
"""Process args."""
if not len(sys.argv) > 1: # pragma: no cover
if not len(sys.argv) > 1:
print("error: wal needs to be given arguments to run.\n"
" Refer to \"wal -h\" for more info.")
exit(1)

View File

@ -22,7 +22,7 @@ def imagemagick(color_count, img):
def gen_colors(img, color_count):
"""Format the output from imagemagick into a list
of hex colors."""
if not shutil.which("convert"): # pragma: no cover
if not shutil.which("convert"):
print("error: imagemagick not found, exiting...\n"
"error: wal requires imagemagick to function.")
exit(1)