mirror of https://github.com/caronc/apprise
travis-ci set to run pep8 tests as part of CI
parent
eb4c83f3f8
commit
75bde9d2a7
|
@ -26,7 +26,7 @@ matrix:
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- pip install .
|
- pip install .
|
||||||
- pip install codecov tox
|
- pip install codecov
|
||||||
- pip install -r dev-requirements.txt
|
- pip install -r dev-requirements.txt
|
||||||
- pip install -r requirements.txt
|
- pip install -r requirements.txt
|
||||||
- if [[ $TRAVIS_PYTHON_VERSION != 'pypy'* ]]; then travis_retry pip install dbus-python; fi
|
- if [[ $TRAVIS_PYTHON_VERSION != 'pypy'* ]]; then travis_retry pip install dbus-python; fi
|
||||||
|
|
|
@ -284,7 +284,7 @@ class NotifyDBus(NotifyBase):
|
||||||
|
|
||||||
self.logger.info('Sent DBus notification.')
|
self.logger.info('Sent DBus notification.')
|
||||||
|
|
||||||
except Exception as e:
|
except Exception:
|
||||||
self.logger.warning('Failed to send DBus notification.')
|
self.logger.warning('Failed to send DBus notification.')
|
||||||
self.logger.exception('DBus Exception')
|
self.logger.exception('DBus Exception')
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -162,7 +162,7 @@ class NotifyGnome(NotifyBase):
|
||||||
notification.show()
|
notification.show()
|
||||||
self.logger.info('Sent Gnome notification.')
|
self.logger.info('Sent Gnome notification.')
|
||||||
|
|
||||||
except Exception as e:
|
except Exception:
|
||||||
self.logger.warning('Failed to send Gnome notification.')
|
self.logger.warning('Failed to send Gnome notification.')
|
||||||
self.logger.exception('Gnome Exception')
|
self.logger.exception('Gnome Exception')
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -173,7 +173,7 @@ class NotifyWindows(NotifyBase):
|
||||||
|
|
||||||
self.logger.info('Sent Windows notification.')
|
self.logger.info('Sent Windows notification.')
|
||||||
|
|
||||||
except Exception as e:
|
except Exception:
|
||||||
self.logger.warning('Failed to send Windows notification.')
|
self.logger.warning('Failed to send Windows notification.')
|
||||||
self.logger.exception('Windows Exception')
|
self.logger.exception('Windows Exception')
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -11,6 +11,12 @@ exclude = .eggs,.tox,gntp,tweepy,pushjet
|
||||||
ignore = E722,W503,W504
|
ignore = E722,W503,W504
|
||||||
statistics = true
|
statistics = true
|
||||||
|
|
||||||
|
[flake8]
|
||||||
|
# We exclude packages we don't maintain
|
||||||
|
exclude = .eggs,.tox,gntp,tweepy,pushjet
|
||||||
|
ignore = E722,W503,W504
|
||||||
|
statistics = true
|
||||||
|
|
||||||
[aliases]
|
[aliases]
|
||||||
test=pytest
|
test=pytest
|
||||||
|
|
||||||
|
|
|
@ -274,7 +274,7 @@ def test_email_plugin(mock_smtp, mock_smtpssl):
|
||||||
# Don't mess with these entries
|
# Don't mess with these entries
|
||||||
raise
|
raise
|
||||||
|
|
||||||
except Exception as e:
|
except Exception:
|
||||||
# We can't handle this exception type
|
# We can't handle this exception type
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,6 @@ from apprise import Apprise
|
||||||
from apprise.utils import compat_is_basestring
|
from apprise.utils import compat_is_basestring
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
import re
|
|
||||||
|
|
||||||
|
|
||||||
TEST_URLS = (
|
TEST_URLS = (
|
||||||
|
@ -195,7 +194,7 @@ def test_growl_plugin(mock_gntp):
|
||||||
# This is the response we expect
|
# This is the response we expect
|
||||||
assert True
|
assert True
|
||||||
|
|
||||||
except Exception as e:
|
except Exception:
|
||||||
# We can't handle this exception type
|
# We can't handle this exception type
|
||||||
assert False
|
assert False
|
||||||
|
|
||||||
|
|
|
@ -168,7 +168,7 @@ def test_plugin(mock_refresh, mock_send):
|
||||||
# Don't mess with these entries
|
# Don't mess with these entries
|
||||||
raise
|
raise
|
||||||
|
|
||||||
except Exception as e:
|
except Exception:
|
||||||
# We can't handle this exception type
|
# We can't handle this exception type
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
|
@ -1660,7 +1660,7 @@ def test_rest_plugins(mock_post, mock_get):
|
||||||
# Don't mess with these entries
|
# Don't mess with these entries
|
||||||
raise
|
raise
|
||||||
|
|
||||||
except Exception as e:
|
except Exception:
|
||||||
# We can't handle this exception type
|
# We can't handle this exception type
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
@ -1697,7 +1697,7 @@ def test_rest_plugins(mock_post, mock_get):
|
||||||
# Don't mess with these entries
|
# Don't mess with these entries
|
||||||
raise
|
raise
|
||||||
|
|
||||||
except Exception as e:
|
except Exception:
|
||||||
# We can't handle this exception type
|
# We can't handle this exception type
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
32
tox.ini
32
tox.ini
|
@ -10,36 +10,45 @@ setenv =
|
||||||
deps=
|
deps=
|
||||||
-r{toxinidir}/requirements.txt
|
-r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/dev-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]
|
[testenv:py27]
|
||||||
deps=
|
deps=
|
||||||
dbus-python
|
dbus-python
|
||||||
-r{toxinidir}/requirements.txt
|
-r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/dev-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]
|
[testenv:py34]
|
||||||
deps=
|
deps=
|
||||||
dbus-python
|
dbus-python
|
||||||
-r{toxinidir}/requirements.txt
|
-r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/dev-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]
|
[testenv:py35]
|
||||||
deps=
|
deps=
|
||||||
dbus-python
|
dbus-python
|
||||||
-r{toxinidir}/requirements.txt
|
-r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/dev-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]
|
[testenv:py36]
|
||||||
deps=
|
deps=
|
||||||
dbus-python
|
dbus-python
|
||||||
-r{toxinidir}/requirements.txt
|
-r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/dev-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]
|
[testenv:py37]
|
||||||
deps=
|
deps=
|
||||||
|
@ -47,21 +56,24 @@ deps=
|
||||||
-r{toxinidir}/requirements.txt
|
-r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/dev-requirements.txt
|
-r{toxinidir}/dev-requirements.txt
|
||||||
commands =
|
commands =
|
||||||
flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
|
|
||||||
coverage run --parallel -m pytest {posargs}
|
coverage run --parallel -m pytest {posargs}
|
||||||
|
flake8 . --count --show-source --statistics
|
||||||
|
|
||||||
[testenv:pypy]
|
[testenv:pypy]
|
||||||
deps=
|
deps=
|
||||||
-r{toxinidir}/requirements.txt
|
-r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/dev-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]
|
[testenv:pypy3]
|
||||||
deps=
|
deps=
|
||||||
-r{toxinidir}/requirements.txt
|
-r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/dev-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]
|
[testenv:coverage-report]
|
||||||
deps = coverage
|
deps = coverage
|
||||||
|
|
Loading…
Reference in New Issue