summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@sonymobile.com>2014-10-27 14:46:48 +0900
committerDavid Pursehouse <david.pursehouse@sonymobile.com>2014-10-27 15:03:43 +0900
commita8df1d9dfe66ec831bbff6f8d194494c866e2c4b (patch)
tree216a2e2df1f78602e5a8c9ba8b3b7d6b2bb23346
parent613c7b2dd28e95d8dd78182d36eaf36760ea58b1 (diff)
downloadpygerrit-a8df1d9dfe66ec831bbff6f8d194494c866e2c4b.tar.gz
Bump pep8 to 1.5.7
And fix a couple of newly discovered warnings. Change-Id: I835d16ed94f2e20f003a2aa0b0370483d02e7926
-rw-r--r--pygerrit/events.py4
-rw-r--r--pygerrit/ssh.py2
-rw-r--r--test_requirements.txt2
-rwxr-xr-xunittests.py3
4 files changed, 6 insertions, 5 deletions
diff --git a/pygerrit/events.py b/pygerrit/events.py
index c6563cd..d71752d 100644
--- a/pygerrit/events.py
+++ b/pygerrit/events.py
@@ -72,10 +72,10 @@ class GerritEventFactory(object):
logging.debug("Failed to load json data: %s: [%s]", str(err), data)
json_data = json.loads(ErrorEvent.error_json(err))
- if not "type" in json_data:
+ if "type" not in json_data:
raise GerritError("`type` not in json_data")
name = json_data["type"]
- if not name in cls._events:
+ if name not in cls._events:
name = 'unhandled-event'
event = cls._events[name]
module_name = event[0]
diff --git a/pygerrit/ssh.py b/pygerrit/ssh.py
index 3ffa97b..2955094 100644
--- a/pygerrit/ssh.py
+++ b/pygerrit/ssh.py
@@ -89,7 +89,7 @@ class GerritSSHClient(SSHClient):
data = config.lookup(self.hostname)
if not data:
raise GerritError("No ssh config for host %s" % self.hostname)
- if not 'hostname' in data or not 'port' in data or not 'user' in data:
+ if 'hostname' not in data or 'port' not in data or 'user' not in data:
raise GerritError("Missing configuration data in %s" % configfile)
self.hostname = data['hostname']
self.username = data['user']
diff --git a/test_requirements.txt b/test_requirements.txt
index 5ae8848..89f4e94 100644
--- a/test_requirements.txt
+++ b/test_requirements.txt
@@ -1,3 +1,3 @@
pep257==0.2.4
-pep8==1.4.6
+pep8==1.5.7
pyflakes==0.7.3
diff --git a/unittests.py b/unittests.py
index 4c962cb..ca841db 100755
--- a/unittests.py
+++ b/unittests.py
@@ -459,7 +459,8 @@ class TestGerritReview(unittest.TestCase):
obj5 = GerritReview(comments=[{'filename': 'Makefile', 'line': 15,
'message': 'test'}, {'filename': 'Make',
- 'line': 10, 'message': 'test1'}])
+ 'line': 10,
+ 'message': 'test1'}])
self.assertEqual(
str(obj5),
'{"comments": {"Make": [{"line": 10, "message": "test1"}],'