diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..55b2d5b --- /dev/null +++ b/.coveragerc @@ -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 diff --git a/.gitignore b/.gitignore index 64baade..f126d42 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ pywal.egg-info/* subprocess re build/* +.coverage diff --git a/.travis.yml b/.travis.yml index e9bbf7e..c420e8e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/pywal/__main__.py b/pywal/__main__.py index 30e0e40..69908fe 100644 --- a/pywal/__main__.py +++ b/pywal/__main__.py @@ -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) diff --git a/pywal/colors.py b/pywal/colors.py index a51a0c7..18a237a 100644 --- a/pywal/colors.py +++ b/pywal/colors.py @@ -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)