diff --git a/.travis.yml b/.travis.yml index 46f1bcc6..c7d4cc6c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ matrix: install: - pip install . - - pip install codecov tox + - pip install codecov - pip install -r dev-requirements.txt - pip install -r requirements.txt - if [[ $TRAVIS_PYTHON_VERSION != 'pypy'* ]]; then travis_retry pip install dbus-python; fi diff --git a/apprise/plugins/NotifyDBus.py b/apprise/plugins/NotifyDBus.py index 5eb79cb2..a9740d24 100644 --- a/apprise/plugins/NotifyDBus.py +++ b/apprise/plugins/NotifyDBus.py @@ -284,7 +284,7 @@ class NotifyDBus(NotifyBase): self.logger.info('Sent DBus notification.') - except Exception as e: + except Exception: self.logger.warning('Failed to send DBus notification.') self.logger.exception('DBus Exception') return False diff --git a/apprise/plugins/NotifyGnome.py b/apprise/plugins/NotifyGnome.py index bfb9ed92..c1f1cd5b 100644 --- a/apprise/plugins/NotifyGnome.py +++ b/apprise/plugins/NotifyGnome.py @@ -162,7 +162,7 @@ class NotifyGnome(NotifyBase): notification.show() self.logger.info('Sent Gnome notification.') - except Exception as e: + except Exception: self.logger.warning('Failed to send Gnome notification.') self.logger.exception('Gnome Exception') return False diff --git a/apprise/plugins/NotifyWindows.py b/apprise/plugins/NotifyWindows.py index df76a3b7..f39a5285 100644 --- a/apprise/plugins/NotifyWindows.py +++ b/apprise/plugins/NotifyWindows.py @@ -173,7 +173,7 @@ class NotifyWindows(NotifyBase): self.logger.info('Sent Windows notification.') - except Exception as e: + except Exception: self.logger.warning('Failed to send Windows notification.') self.logger.exception('Windows Exception') return False diff --git a/setup.cfg b/setup.cfg index f1e329a3..5ae99e9a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -11,6 +11,12 @@ exclude = .eggs,.tox,gntp,tweepy,pushjet ignore = E722,W503,W504 statistics = true +[flake8] +# We exclude packages we don't maintain +exclude = .eggs,.tox,gntp,tweepy,pushjet +ignore = E722,W503,W504 +statistics = true + [aliases] test=pytest diff --git a/test/test_email_plugin.py b/test/test_email_plugin.py index fa0a9266..a067b65c 100644 --- a/test/test_email_plugin.py +++ b/test/test_email_plugin.py @@ -274,7 +274,7 @@ def test_email_plugin(mock_smtp, mock_smtpssl): # Don't mess with these entries raise - except Exception as e: + except Exception: # We can't handle this exception type raise diff --git a/test/test_growl_plugin.py b/test/test_growl_plugin.py index 295ec5fb..e92742f2 100644 --- a/test/test_growl_plugin.py +++ b/test/test_growl_plugin.py @@ -29,7 +29,6 @@ from apprise import Apprise from apprise.utils import compat_is_basestring import mock -import re TEST_URLS = ( @@ -195,7 +194,7 @@ def test_growl_plugin(mock_gntp): # This is the response we expect assert True - except Exception as e: + except Exception: # We can't handle this exception type assert False diff --git a/test/test_pushjet_plugin.py b/test/test_pushjet_plugin.py index f2d19028..29642223 100644 --- a/test/test_pushjet_plugin.py +++ b/test/test_pushjet_plugin.py @@ -168,7 +168,7 @@ def test_plugin(mock_refresh, mock_send): # Don't mess with these entries raise - except Exception as e: + except Exception: # We can't handle this exception type raise diff --git a/test/test_rest_plugins.py b/test/test_rest_plugins.py index 728b87cd..ded27f11 100644 --- a/test/test_rest_plugins.py +++ b/test/test_rest_plugins.py @@ -1660,7 +1660,7 @@ def test_rest_plugins(mock_post, mock_get): # Don't mess with these entries raise - except Exception as e: + except Exception: # We can't handle this exception type raise @@ -1697,7 +1697,7 @@ def test_rest_plugins(mock_post, mock_get): # Don't mess with these entries raise - except Exception as e: + except Exception: # We can't handle this exception type raise diff --git a/tox.ini b/tox.ini index 3ca38ef7..3a5af053 100644 --- a/tox.ini +++ b/tox.ini @@ -10,36 +10,45 @@ setenv = deps= -r{toxinidir}/requirements.txt -r{toxinidir}/dev-requirements.txt -commands = python -m pytest {posargs} - +commands = + coverage run --parallel -m pytest {posargs} + flake8 . --count --show-source --statistics [testenv:py27] deps= dbus-python -r{toxinidir}/requirements.txt -r{toxinidir}/dev-requirements.txt -commands = coverage run --parallel -m pytest {posargs} +commands = + coverage run --parallel -m pytest {posargs} + flake8 . --count --show-source --statistics [testenv:py34] deps= dbus-python -r{toxinidir}/requirements.txt -r{toxinidir}/dev-requirements.txt -commands = coverage run --parallel -m pytest {posargs} +commands = + coverage run --parallel -m pytest {posargs} + flake8 . --count --show-source --statistics [testenv:py35] deps= dbus-python -r{toxinidir}/requirements.txt -r{toxinidir}/dev-requirements.txt -commands = coverage run --parallel -m pytest {posargs} +commands = + coverage run --parallel -m pytest {posargs} + flake8 . --count --show-source --statistics [testenv:py36] deps= dbus-python -r{toxinidir}/requirements.txt -r{toxinidir}/dev-requirements.txt -commands = coverage run --parallel -m pytest {posargs} +commands = + coverage run --parallel -m pytest {posargs} + flake8 . --count --show-source --statistics [testenv:py37] deps= @@ -47,21 +56,24 @@ deps= -r{toxinidir}/requirements.txt -r{toxinidir}/dev-requirements.txt commands = - flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics coverage run --parallel -m pytest {posargs} + flake8 . --count --show-source --statistics [testenv:pypy] deps= -r{toxinidir}/requirements.txt -r{toxinidir}/dev-requirements.txt -commands = coverage run --parallel -m pytest {posargs} +commands = + coverage run --parallel -m pytest {posargs} + flake8 . --count --show-source --statistics [testenv:pypy3] deps= -r{toxinidir}/requirements.txt -r{toxinidir}/dev-requirements.txt -commands = coverage run --parallel -m pytest {posargs} - +commands = + coverage run --parallel -m pytest {posargs} + flake8 . --count --show-source --statistics [testenv:coverage-report] deps = coverage