This is an automated email from the ASF dual-hosted git repository.

kgiusti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git


The following commit(s) were added to refs/heads/master by this push:
     new b60ceca  DISPATCH-1529: fix/mask various python-checker lint warnings
b60ceca is described below

commit b60cecacc47efa7c6ae82865e44d0796c127d4b2
Author: Kenneth Giusti <[email protected]>
AuthorDate: Tue Dec 17 11:49:20 2019 -0500

    DISPATCH-1529: fix/mask various python-checker lint warnings
    
    This closes #649
---
 .travis.yml                             |  1 +
 docs/man/help2txt.py                    |  2 +-
 tests/system_tests_distribution.py      | 95 ++++++++++++++++-----------------
 tests/system_tests_edge_router.py       |  2 +-
 tests/system_tests_fallback_dest.py     |  2 +-
 tests/system_tests_interior_sync_up.py  |  2 +-
 tests/system_tests_link_route_credit.py |  2 +-
 tests/system_tests_multi_phase.py       |  2 +-
 tests/system_tests_ssl.py               |  2 +-
 tests/system_tests_stuck_deliveries.py  |  2 +-
 tests/test_broker.py                    | 10 ++--
 tests/tox.ini.in                        |  2 +-
 tools/scraper/log_splitter.py           |  2 +-
 tools/scraper/nicknamer.py              |  4 +-
 14 files changed, 64 insertions(+), 66 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index aa89cca..5052721 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -85,6 +85,7 @@ addons:
     - dblatex
     # unit test requirement
     - python-unittest2
+    - tox
     # code coverage
     - lcov
 
diff --git a/docs/man/help2txt.py b/docs/man/help2txt.py
index 24aeb53..14a156d 100644
--- a/docs/man/help2txt.py
+++ b/docs/man/help2txt.py
@@ -55,7 +55,7 @@ def help2txt(help_out):
         if item.group(3):
             result += heading(item.group(3).strip(), 3)
         else:
-            result += "%s\n:   %s\n\n" % (item.group(1), re.sub("\s+", " ", 
item.group(2)).strip())
+            result += "%s\n:   %s\n\n" % (item.group(1), re.sub(r"\s+", " ", 
item.group(2)).strip())
     return result
 
 def main(argv):
diff --git a/tests/system_tests_distribution.py 
b/tests/system_tests_distribution.py
index 377bd47..745f807 100644
--- a/tests/system_tests_distribution.py
+++ b/tests/system_tests_distribution.py
@@ -1291,23 +1291,22 @@ class DistributionTests ( TestCase ):
     @SkipIfNeeded(DistributionSkipMapper.skip['test_20'], 'Test skipped during 
development.')
     def test_20_linkroute_mesh_all_local ( self ) :
         name='test_20'
-        """
-                       c           c
-        senders --->   A --------- B
-                        \         /
-                         \       /
-                          \     /
-                           \   /
-                            \ /
-                             D
-                             c
-
-        'c' indicates that I make connections to the route-container
-        listeners at the marked routers.
-
-        This test should route all senders' link-attaches
-        to the local containers on router A.
-        """
+        #
+        #                c           c
+        # senders --->   A --------- B
+        #                \         /
+        #                 \       /
+        #                  \     /
+        #                   \   /
+        #                    \ /
+        #                     D
+        #                     c
+
+        # 'c' indicates that I make connections to the route-container
+        # listeners at the marked routers.
+
+        # This test should route all senders' link-attaches
+        # to the local containers on router A.
 
         addr_suffix = "addr_20"
 
@@ -1393,23 +1392,22 @@ class DistributionTests ( TestCase ):
     @SkipIfNeeded(DistributionSkipMapper.skip['test_21'], 'Test skipped during 
development.')
     def test_21_linkroute_mesh_nonlocal ( self ) :
         name='test_21'
-        """
-                                   c
-        senders --->   A --------- B
-                        \         /
-                         \       /
-                          \     /
-                           \   /
-                            \ /
-                             D
-                             c
-
-        'c' indicates that I make connections to the route-container
-        listeners at the marked routers.
-
-        This test should split all senders' link-attaches
-        between the connections on routers B and D.
-        """
+        #
+        #                            c
+        # senders --->   A --------- B
+        #                 \         /
+        #                  \       /
+        #                   \     /
+        #                    \   /
+        #                     \ /
+        #                      D
+        #                      c
+
+        # 'c' indicates that I make connections to the route-container
+        # listeners at the marked routers.
+
+        # This test should split all senders' link-attaches
+        # between the connections on routers B and D.
 
         addr_suffix = "addr_21"
 
@@ -1497,20 +1495,19 @@ class DistributionTests ( TestCase ):
     @SkipIfNeeded(DistributionSkipMapper.skip['test_22'], 'Test skipped during 
development.')
     def test_22_linkroute_mesh_kill ( self ) :
         name='test_22'
-        """
-                       c           c
-        senders --->   A --------- B
-                        \         /
-                         \       /
-                          \     /
-                           \   /
-                            \ /
-                             D
-                             c
-
-        'c' indicates that I make connections to the route-container
-        listeners at the marked routers.
-        """
+
+        #               c           c
+        # senders --->   A --------- B
+        #                 \         /
+        #                  \       /
+        #                   \     /
+        #                    \   /
+        #                     \ /
+        #                      D
+        #                      c
+
+        # 'c' indicates that I make connections to the route-container
+        # listeners at the marked routers.
 
         addr_suffix = "addr_22"
 
@@ -2806,7 +2803,7 @@ class MulticastTest ( MessagingHandler ):
     def on_message ( self, event ):
 
         #if self.bailed is True :
-            #return
+        #    return
 
         if event.receiver == self.addr_check_receiver:
             # This is a response to one of my address-readiness checking 
messages.
diff --git a/tests/system_tests_edge_router.py 
b/tests/system_tests_edge_router.py
index a2238f4..72fe737 100644
--- a/tests/system_tests_edge_router.py
+++ b/tests/system_tests_edge_router.py
@@ -48,7 +48,7 @@ class AddrTimer(object):
         self.parent = parent
 
     def on_timer_task(self, event):
-            self.parent.check_address()
+        self.parent.check_address()
 
 
 class EdgeRouterTest(TestCase):
diff --git a/tests/system_tests_fallback_dest.py 
b/tests/system_tests_fallback_dest.py
index 1e870cc..e117517 100644
--- a/tests/system_tests_fallback_dest.py
+++ b/tests/system_tests_fallback_dest.py
@@ -46,7 +46,7 @@ class AddrTimer(object):
         self.parent = parent
 
     def on_timer_task(self, event):
-            self.parent.check_address()
+        self.parent.check_address()
 
 
 class RouterTest(TestCase):
diff --git a/tests/system_tests_interior_sync_up.py 
b/tests/system_tests_interior_sync_up.py
index ff21d30..2b220f0 100644
--- a/tests/system_tests_interior_sync_up.py
+++ b/tests/system_tests_interior_sync_up.py
@@ -44,7 +44,7 @@ class AddrTimer(object):
         self.parent = parent
 
     def on_timer_task(self, event):
-            self.parent.check_address()
+        self.parent.check_address()
 
 
 class RouterTest(TestCase):
diff --git a/tests/system_tests_link_route_credit.py 
b/tests/system_tests_link_route_credit.py
index 16ab0f3..5385dd7 100644
--- a/tests/system_tests_link_route_credit.py
+++ b/tests/system_tests_link_route_credit.py
@@ -44,7 +44,7 @@ class AddrTimer(object):
         self.parent = parent
 
     def on_timer_task(self, event):
-            self.parent.check_address()
+        self.parent.check_address()
 
 
 class RouterTest(TestCase):
diff --git a/tests/system_tests_multi_phase.py 
b/tests/system_tests_multi_phase.py
index 60c9ac7..c5cf44c 100644
--- a/tests/system_tests_multi_phase.py
+++ b/tests/system_tests_multi_phase.py
@@ -46,7 +46,7 @@ class AddrTimer(object):
         self.parent = parent
 
     def on_timer_task(self, event):
-            self.parent.check_address()
+        self.parent.check_address()
 
 
 class RouterTest(TestCase):
diff --git a/tests/system_tests_ssl.py b/tests/system_tests_ssl.py
index fa53fea..f6026c4 100644
--- a/tests/system_tests_ssl.py
+++ b/tests/system_tests_ssl.py
@@ -113,7 +113,7 @@ class RouterTestSslClient(RouterTestSslBase):
         try:
             p = Popen(['openssl', 'version'], stdout=PIPE, 
universal_newlines=True)
             openssl_out = p.communicate()[0]
-            m = re.search('[0-9]+\.[0-9]+\.[0-9]+', openssl_out)
+            m = re.search(r'[0-9]+\.[0-9]+\.[0-9]+', openssl_out)
             OPENSSL_OUT_VER = m.group(0)
             OPENSSL_VER_1_1_GT = StrictVersion(OPENSSL_OUT_VER) >= 
StrictVersion('1.1')
             print("OpenSSL Version found = %s" % OPENSSL_OUT_VER)
diff --git a/tests/system_tests_stuck_deliveries.py 
b/tests/system_tests_stuck_deliveries.py
index 7758126..65021a2 100644
--- a/tests/system_tests_stuck_deliveries.py
+++ b/tests/system_tests_stuck_deliveries.py
@@ -46,7 +46,7 @@ class AddrTimer(object):
         self.parent = parent
 
     def on_timer_task(self, event):
-            self.parent.check_address()
+        self.parent.check_address()
 
 
 class RouterTest(TestCase):
diff --git a/tests/test_broker.py b/tests/test_broker.py
index 89bf6fd..3b99bac 100644
--- a/tests/test_broker.py
+++ b/tests/test_broker.py
@@ -173,11 +173,11 @@ class FakeBroker(MessagingHandler):
         self.remove_stale_consumers(event.connection)
 
     def remove_stale_consumers(self, connection):
-        l = connection.link_head(Endpoint.REMOTE_ACTIVE)
-        while l:
-            if l.is_sender:
-                self._unsubscribe(l)
-            l = l.next(Endpoint.REMOTE_ACTIVE)
+        link = connection.link_head(Endpoint.REMOTE_ACTIVE)
+        while link:
+            if link.is_sender:
+                self._unsubscribe(link)
+            link = link.next(Endpoint.REMOTE_ACTIVE)
 
     def on_sendable(self, event):
         self.out_count += 
self._queue(event.link.source.address).dispatch(event.link)
diff --git a/tests/tox.ini.in b/tests/tox.ini.in
index c2d1405..84d3f41 100644
--- a/tests/tox.ini.in
+++ b/tests/tox.ini.in
@@ -27,7 +27,7 @@ skip_install = True
 [testenv]
 # we ignore lots of errors/warnings we probably should not,
 # but it will take a lot of effort to make the code PEP8 compliant...
-commands = flake8 --count ${CMAKE_SOURCE_DIR}/python 
${CMAKE_SOURCE_DIR}/console ${CMAKE_SOURCE_DIR}/docs ${CMAKE_SOURCE_DIR}/tests 
${CMAKE_SOURCE_DIR}/tools --show-source 
--ignore=E111,E114,E121,E122,E123,E124,E126,E127,E128,E129,E131,E201,E202,E203,E211,E221,E222,E225,E226,E228,E231,E241,E251,E261,E266,E265,E271,E272,E301,E302,E303,E401,E402,E501,E502,E701,E702,E703,E704,E711,E712,E713,E714,E731,F401,F403,F405,F811,F841,H101,H102,H104,H201,H202,H234,H237,H238,H301,H306,H401,H403,H404,H
 [...]
+commands = flake8 --count ${CMAKE_SOURCE_DIR}/python 
${CMAKE_SOURCE_DIR}/console ${CMAKE_SOURCE_DIR}/docs ${CMAKE_SOURCE_DIR}/tests 
${CMAKE_SOURCE_DIR}/tools --show-source 
--ignore=E111,E114,E121,E122,E123,E124,E126,E127,E128,E129,E131,E201,E202,E203,E211,E221,E222,E225,E226,E228,E231,E241,E251,E261,E266,E265,E271,E272,E301,E302,E303,E305,E306,E401,E402,E501,E502,E701,E702,E703,E704,E711,E712,E713,E714,E731,E722,F401,F403,F405,F811,F841,H101,H102,H104,H201,H202,H234,H237,H238,H301,H306,H
 [...]
 deps = hacking>=1.1.0
 
 # flake8 no longer supports python2.6
diff --git a/tools/scraper/log_splitter.py b/tools/scraper/log_splitter.py
index 321c1d7..72f03b8 100755
--- a/tools/scraper/log_splitter.py
+++ b/tools/scraper/log_splitter.py
@@ -255,7 +255,7 @@ class LogFile:
                         curr_conn.peer_open = line
                         curr_conn.peer_type = key_prod_dispatch
                     elif key_prod_aqpidjms in line:
-                            curr_conn.peer_type = key_prod_aqpidjms
+                        curr_conn.peer_type = key_prod_aqpidjms
                     else:
                         for k in [key_prod_aartemis, key_prod_aqpidcpp]:
                             if k in line:
diff --git a/tools/scraper/nicknamer.py b/tools/scraper/nicknamer.py
index 35eb367..2e7e4a3 100755
--- a/tools/scraper/nicknamer.py
+++ b/tools/scraper/nicknamer.py
@@ -119,8 +119,8 @@ class ShortNames():
 
     def sort_customers(self):
         for c in common.dict_iterkeys(self.customer_dict):
-            l = self.customer_dict[c]
-            self.customer_dict[c] = sorted(l, key=lambda lfl: lfl.datetime)
+            x = self.customer_dict[c]
+            self.customer_dict[c] = sorted(x, key=lambda lfl: lfl.datetime)
 
     def customers(self, sname):
         return self.customer_dict[sname]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to