diff --git a/driverlog/processor/main.py b/driverlog/processor/main.py index 1493a81..161b977 100644 --- a/driverlog/processor/main.py +++ b/driverlog/processor/main.py @@ -29,9 +29,7 @@ LOG = logging.getLogger(__name__) def _find_vote(review, ci_id): - """ - Finds vote corresponding to ci_id - """ + """Finds vote corresponding to ci_id.""" for approval in (review['currentPatchSet'].get('approvals') or []): if approval['type'] not in ['Verified', 'VRIF']: continue @@ -43,9 +41,7 @@ def _find_vote(review, ci_id): def find_ci_result(review_iterator, ci): - """ - For a given stream of reviews finds result left by specified ci - """ + """For a given stream of reviews finds result left by specified ci.""" for review in review_iterator: review_url = review['url'] @@ -85,9 +81,7 @@ def find_ci_result(review_iterator, ci): def _get_release_by_branch(releases, branch): - """ - Translates branch name into release_id - """ + """Translates branch name into release_id.""" release = branch.lower() if release.find('/') > 0: return release.split('/')[1] @@ -96,8 +90,8 @@ def _get_release_by_branch(releases, branch): def update_drivers(drivers, releases): - """ - Iterates all drivers and searches for results produced by their CIs + """Iterates all drivers and searches for results produced by their CIs. + Returns True if info was updated """ branches = [('stable/' + r['id'].lower()) for r in releases] + ['master'] diff --git a/test-requirements.txt b/test-requirements.txt index 18f8ce1..a468217 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,4 @@ -hacking>=0.8.0,<0.9 +hacking>=0.9.2,<0.10 coverage>=3.6 discover diff --git a/tests/unit/test_main.py b/tests/unit/test_main.py index f3ff1e1..efd82b8 100644 --- a/tests/unit/test_main.py +++ b/tests/unit/test_main.py @@ -14,12 +14,12 @@ # limitations under the License. import json -import memcache -import mock from driverlog.processor import main from driverlog.processor import utils +import memcache +import mock import testtools diff --git a/tox.ini b/tox.ini index 8fdd644..4317824 100644 --- a/tox.ini +++ b/tox.ini @@ -34,7 +34,9 @@ commands = python setup.py build_sphinx [flake8] # E125 continuation line does not distinguish itself from next logical line # H404 multi line docstring should start with a summary -ignore = E125,H404 +# E251 unexpected spaces around keyword / parameter equals +# E714 test for object identity should be 'is not' +ignore = E125,H404,E251,E714 show-source = true builtins = _ exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools,build