[flake8] fixes

authorArthur Lutz <arthur.lutz@logilab.fr>
changesetc0284229c882
branchdefault
phasepublic
hiddenno
parent revision#5d406a9ccf98 [.gitlab-ci.yml] initial version from tox envlist
child revision#48aae07a4cb3 Migrate cube to Python3
files modified by this revision
cubicweb_elasticsearch/ccplugin.py
cubicweb_elasticsearch/testutils.py
# HG changeset patch
# User Arthur Lutz <arthur.lutz@logilab.fr>
# Date 1561719532 -7200
# Fri Jun 28 12:58:52 2019 +0200
# Node ID c0284229c8821000fe7e1c2d2471ec6abd80495a
# Parent 5d406a9ccf98911fb1b7ac7740541eb355386870
[flake8] fixes

diff --git a/cubicweb_elasticsearch/ccplugin.py b/cubicweb_elasticsearch/ccplugin.py
@@ -102,11 +102,11 @@
1                      indexable_entities(
2                          cnx, etype, chunksize=self.config.chunksize), 1):
3                  try:
4                      serializer = entity.cw_adapt_to('IFullTextIndexSerializable')
5                      json = serializer.serialize(complete=False)
6 -                except Exception as e:
7 +                except Exception:
8                      cnx.error('[{}] Failed to serialize entity {} ({})'.format(
9                          index_name, entity.eid, etype))
10                      continue
11                  if not dry_run and json:
12                      # Entities with
diff --git a/cubicweb_elasticsearch/testutils.py b/cubicweb_elasticsearch/testutils.py
@@ -33,12 +33,13 @@
13 
14      @classmethod
15      def setUpClass(cls):
16          try:
17              httplib.HTTPConnection('localhost:9200').request('GET', '/')
18 -        except:
19 -            raise unittest.SkipTest('No ElasticSearch on localhost, skipping test')
20 +        except:  # noqa
21 +            raise unittest.SkipTest(
22 +                'No ElasticSearch on localhost, skipping test')
23          super(RealESTestMixin, cls).setUpClass()
24 
25      def setup_database(self):
26          super(RealESTestMixin, self).setup_database()
27          self.config.global_set_option('elasticsearch-locations',