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

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


The following commit(s) were added to refs/heads/main by this push:
     new d8a1f40  DISPATCH-1974 Add pylint checker with suppressions (#1503)
d8a1f40 is described below

commit d8a1f40ebdf198f798745678c78e99d045e3aa74
Author: Jiri DanÄ›k <[email protected]>
AuthorDate: Sat Jan 8 14:15:32 2022 +0100

    DISPATCH-1974 Add pylint checker with suppressions (#1503)
    
    resolves #1503
---
 bin/grinder                                        |   4 +-
 python/qpid_dispatch/management/client.py          |  37 ++++----
 python/qpid_dispatch/management/entity.py          |   2 +-
 .../display_name/display_name.py                   |   4 +-
 python/qpid_dispatch_internal/management/agent.py  |  26 +++---
 python/qpid_dispatch_internal/management/config.py |   2 +-
 .../qpid_dispatch_internal/management/qdrouter.py  |   5 +-
 python/qpid_dispatch_internal/management/schema.py |  12 +--
 .../management/schema_doc.py                       |   2 +-
 .../qpid_dispatch_internal/policy/policy_local.py  |  32 +++----
 .../policy/policy_manager.py                       |  11 +--
 .../qpid_dispatch_internal/policy/policy_util.py   |  16 ++--
 python/qpid_dispatch_internal/router/address.py    |   6 +-
 python/qpid_dispatch_internal/router/data.py       |  14 +--
 python/qpid_dispatch_internal/router/engine.py     |  10 +-
 python/qpid_dispatch_internal/router/hello.py      |   2 +-
 python/qpid_dispatch_internal/router/link.py       |   2 +-
 python/qpid_dispatch_internal/router/message.py    |   5 +-
 python/qpid_dispatch_internal/router/node.py       |   8 +-
 python/qpid_dispatch_internal/router/path.py       |   4 +-
 python/qpid_dispatch_internal/tools/command.py     |   6 +-
 python/qpid_dispatch_internal/tools/display.py     |   8 +-
 src/schema_c.py                                    |   4 +-
 tests/TCP_echo_client.py                           |   2 +-
 tests/TCP_echo_server.py                           |   2 +-
 tests/friendship_pb2_grpc.py                       |   6 +-
 tests/http1_tests.py                               |  20 ++--
 tests/http2_server.py                              |   9 +-
 tests/http2_slow_q2_server.py                      |   2 +-
 tests/router_engine_test.py                        |   6 +-
 tests/router_policy_test.py                        |  10 +-
 tests/system_test.py                               |  18 ++--
 tests/system_tests_autolinks.py                    |   8 +-
 tests/system_tests_broker.py                       |   3 +-
 tests/system_tests_connector_status.py             |   2 +-
 tests/system_tests_console.py                      |   2 +-
 tests/system_tests_core_client.py                  |   4 +-
 tests/system_tests_core_endpoint.py                |   7 +-
 tests/system_tests_delivery_abort.py               |   8 +-
 tests/system_tests_delivery_counts.py              |  10 +-
 tests/system_tests_distribution.py                 |  25 +++--
 tests/system_tests_drain.py                        |  10 +-
 tests/system_tests_drain_support.py                |   2 +-
 tests/system_tests_dynamic_terminus.py             |   3 +-
 tests/system_tests_edge_router.py                  |  28 +++---
 tests/system_tests_failover_list.py                |   4 +-
 tests/system_tests_fallback_dest.py                |  10 +-
 tests/system_tests_grpc.py                         |   8 +-
 tests/system_tests_heartbeats.py                   |   5 +-
 tests/system_tests_http.py                         |  12 +--
 tests/system_tests_http1_adaptor.py                |   2 +-
 tests/system_tests_http2.py                        |  13 +--
 tests/system_tests_interior_sync_up.py             |   4 +-
 tests/system_tests_link_route_credit.py            |   9 +-
 tests/system_tests_link_routes.py                  |  13 ++-
 ...system_tests_link_routes_add_external_prefix.py |   8 +-
 tests/system_tests_log_level_update.py             |  13 +--
 tests/system_tests_log_message_components.py       |   9 +-
 tests/system_tests_management.py                   |  16 ++--
 tests/system_tests_multi_phase.py                  |   5 +-
 tests/system_tests_multi_tenancy.py                |   8 +-
 tests/system_tests_multi_tenancy_policy.py         |   8 +-
 tests/system_tests_multicast.py                    |  17 ++--
 tests/system_tests_one_router.py                   |  37 ++++----
 tests/system_tests_policy.py                       |   6 +-
 tests/system_tests_policy_oversize_compound.py     |  25 ++---
 tests/system_tests_priority.py                     |   7 +-
 tests/system_tests_qdmanage.py                     |  10 +-
 tests/system_tests_qdstat.py                       |   6 +-
 tests/system_tests_routing_protocol.py             |   5 +-
 tests/system_tests_ssl.py                          |  16 ++--
 tests/system_tests_stuck_deliveries.py             |  11 ++-
 tests/system_tests_tcp_adaptor.py                  |  37 ++++----
 tests/system_tests_topology.py                     |  20 ++--
 tests/system_tests_topology_addition.py            |   5 +-
 tests/system_tests_topology_disposition.py         |  15 ++-
 tests/system_tests_two_routers.py                  |  18 ++--
 tests/test_broker.py                               |   2 +-
 tests/tox.ini.in                                   | 101 +++++++++++++++++++--
 tools/qdstat                                       |   2 +-
 tools/scraper/parser.py                            |   2 +-
 81 files changed, 505 insertions(+), 393 deletions(-)

diff --git a/bin/grinder b/bin/grinder
index 9a4aa77..e6db5fa 100755
--- a/bin/grinder
+++ b/bin/grinder
@@ -42,7 +42,7 @@ import xml.etree.ElementTree as ET
 from xml.etree.ElementTree import ParseError
 
 
-class Frame(object):
+class Frame:
     """
     Represents info for a single stack frame
     """
@@ -64,7 +64,7 @@ class Frame(object):
         return hash(self.__str__())
 
 
-class ErrorBase(object):
+class ErrorBase:
     """
     Base class representing a single valgrind error
     """
diff --git a/python/qpid_dispatch/management/client.py 
b/python/qpid_dispatch/management/client.py
index 030b539..b62ce2b 100644
--- a/python/qpid_dispatch/management/client.py
+++ b/python/qpid_dispatch/management/client.py
@@ -17,15 +17,14 @@
 # under the License
 #
 
-"""
-AMQP management client for Qpid dispatch.
-"""
+"""AMQP management client for Qpid dispatch."""
 
 import proton
 from proton import Url
-from .error import *  # noqa F403: import all error symbols for convenience to 
users.
+from proton.utils import BlockingConnection, SyncRequestResponse
+
+from . import error
 from .entity import EntityBase, clean_dict
-from proton.utils import SyncRequestResponse, BlockingConnection
 
 
 class Entity(EntityBase):
@@ -49,7 +48,7 @@ class Entity(EntityBase):
         super(Entity, self).__init__(attributes, **kwattrs)
         self.__dict__['_node'] = node  # Avoid getattr recursion
 
-    def call(self, operation, expect=OK, **arguments):
+    def call(self, operation, expect=error.OK, **arguments):
         """Call an arbitrary management method on this entity"""
         request = self._node.request(
             operation=operation, type=self.type, identity=self.identity, 
**arguments)
@@ -57,18 +56,18 @@ class Entity(EntityBase):
 
     def read(self):
         """Read the remote entity attributes into the local attributes."""
-        self.attributes = self.call('READ', expect=OK)
+        self.attributes = self.call('READ', expect=error.OK)
 
     def update(self):
         """Update the remote entity attributes from the local attributes."""
-        self.attributes = self.call('UPDATE', expect=OK, body=self.attributes)
+        self.attributes = self.call('UPDATE', expect=error.OK, 
body=self.attributes)
 
     def delete(self):
         """Delete the remote entity"""
-        self.call('DELETE', expect=NO_CONTENT)
+        self.call('DELETE', expect=error.NO_CONTENT)
 
 
-class Node(object):
+class Node:
     """Client proxy for an AMQP management node"""
 
     def clean_attrs(self, attrs):
@@ -153,7 +152,7 @@ class Node(object):
         return "%s(%s)" % (self.__class__.__name__, self.url)
 
     @staticmethod
-    def check_response(response, expect=OK):
+    def check_response(response, expect=error.OK):
         """
         Check a management response message for errors and correlation ID.
         """
@@ -161,10 +160,10 @@ class Node(object):
         if code != expect:
             if 200 <= code <= 299:
                 raise ValueError("Response was %s(%s) but expected %s(%s): %s" 
% (
-                    code, STATUS_TEXT[code], expect, STATUS_TEXT[expect],
+                    code, error.STATUS_TEXT[code], expect, 
error.STATUS_TEXT[expect],
                     response.properties.get('statusDescription')))
             else:
-                raise ManagementError.create(code, 
response.properties.get('statusDescription'))
+                raise error.ManagementError.create(code, 
response.properties.get('statusDescription'))
 
     def request(self, body=None, **properties):
         """
@@ -184,7 +183,7 @@ class Node(object):
         """Construct a request for the managment node itself"""
         return self.request(body, name=self.name, type=self.type, **properties)
 
-    def call(self, request, expect=OK):
+    def call(self, request, expect=error.OK):
         """
         Send a management request message, wait for a response.
         @return: Response message.
@@ -193,7 +192,7 @@ class Node(object):
         self.check_response(response, expect=expect)
         return response
 
-    class QueryResponse(object):
+    class QueryResponse:
         """
         Result returned by L{query}.
         @ivar attribute_names: List of attribute names for the results.
@@ -229,11 +228,11 @@ class Node(object):
 
         def get_dicts(self, clean=False):
             """Results as list of dicts."""
-            return [d for d in self.iter_dicts(clean=clean)]
+            return list(self.iter_dicts(clean=clean))
 
         def get_entities(self, clean=False):
             """Results as list of entities."""
-            return [d for d in self.iter_entities(clean=clean)]
+            return list(self.iter_entities(clean=clean))
 
         def __repr__(self):
             return "QueryResponse(attribute_names=%r, results=%r" % 
(self.attribute_names, self.results)
@@ -314,7 +313,7 @@ class Node(object):
         type = type or attributes.get('type')
         name = name or attributes.get('name')
         request = self.request(operation='CREATE', type=type, name=name, 
body=attributes)
-        return Entity(self, self.call(request, expect=CREATED).body)
+        return Entity(self, self.call(request, expect=error.CREATED).body)
 
     def read(self, type=None, name=None, identity=None):
         """
@@ -367,7 +366,7 @@ class Node(object):
             name = None  # Only specify one
         request = self.request(operation='DELETE', type=type, name=name,
                                identity=identity)
-        self.call(request, expect=NO_CONTENT)
+        self.call(request, expect=error.NO_CONTENT)
 
     def get_types(self, type=None):
         return self.call(self.node_request(operation="GET-TYPES", 
entityType=type)).body
diff --git a/python/qpid_dispatch/management/entity.py 
b/python/qpid_dispatch/management/entity.py
index c16be93..8d8004e 100644
--- a/python/qpid_dispatch/management/entity.py
+++ b/python/qpid_dispatch/management/entity.py
@@ -37,7 +37,7 @@ def clean_dict(items, **kwargs):
                 if v is not None)
 
 
-class EntityBase(object):
+class EntityBase:
     """
     A collection of named attributes.
 
diff --git a/python/qpid_dispatch_internal/display_name/display_name.py 
b/python/qpid_dispatch_internal/display_name/display_name.py
index c02e614..7638722 100644
--- a/python/qpid_dispatch_internal/display_name/display_name.py
+++ b/python/qpid_dispatch_internal/display_name/display_name.py
@@ -30,7 +30,7 @@ import traceback
 from qpid_dispatch_internal import dispatch
 
 
-class SSLProfile(object):
+class SSLProfile:
     def __init__(self, profile_name, profile_file):
         super(SSLProfile, self).__init__()
         self.profile_name = profile_name
@@ -45,7 +45,7 @@ class SSLProfile(object):
         return "SSLProfile(%s)" % ", ".join("%s=%s" % (k, self.cache[k]) for k 
in self.cache.keys())
 
 
-class DisplayNameService(object):
+class DisplayNameService:
 
     def __init__(self):
         super(DisplayNameService, self).__init__()
diff --git a/python/qpid_dispatch_internal/management/agent.py 
b/python/qpid_dispatch_internal/management/agent.py
index e315dc6..0e5b2a9 100644
--- a/python/qpid_dispatch_internal/management/agent.py
+++ b/python/qpid_dispatch_internal/management/agent.py
@@ -76,12 +76,12 @@ from ctypes import c_void_p, py_object, c_long
 from subprocess import Popen
 
 import qpid_dispatch_site
-from ..dispatch import IoAdapter, LogAdapter, LOG_INFO, LOG_WARNING, 
LOG_DEBUG, LOG_ERROR, TREATMENT_ANYCAST_CLOSEST
+from qpid_dispatch.management.entity import camelcase
 from qpid_dispatch.management.error import ManagementError, OK, CREATED, 
NO_CONTENT, STATUS_TEXT, \
     BadRequestStatus, InternalServerErrorStatus, NotImplementedStatus, 
NotFoundStatus
-from qpid_dispatch.management.entity import camelcase
 from .schema import ValidationError, SchemaEntity, EntityType
 from .qdrouter import QdSchema
+from ..dispatch import IoAdapter, LogAdapter, LOG_INFO, LOG_WARNING, 
LOG_DEBUG, LOG_ERROR, TREATMENT_ANYCAST_CLOSEST
 from ..router.message import Message
 from ..router.address import Address
 from ..policy.policy_manager import PolicyManager
@@ -104,7 +104,7 @@ def not_implemented(operation, entity_type):
     raise NotImplementedStatus("Operation '%s' not implemented on %s"  % 
(operation, entity_type))
 
 
-class AtomicCount(object):
+class AtomicCount:
     """Simple atomic counter"""
 
     def __init__(self, count=0):
@@ -118,7 +118,7 @@ class AtomicCount(object):
             return n
 
 
-class Implementation(object):
+class Implementation:
     """Abstract implementation wrapper"""
 
     def __init__(self, entity_type, key):
@@ -255,18 +255,18 @@ class RouterEntity(EntityAdapter):
         return self.attributes.get('id')
 
     def create(self):
-        if u"id" in self.attributes.keys():
-            for ch in self.attributes[u"id"]:
+        if "id" in self.attributes.keys():
+            for ch in self.attributes["id"]:
                 try:
                     disallowed = unicodedata.category(ch)[0] in "CZ"
                 except TypeError:
                     disallowed = unicodedata.category(ch.decode('utf-8'))[0] 
in "CZ"
                 if disallowed:  # disallow control and whitespace characters
-                    raise AttributeError("Router id attribute containing 
character '%s' in id '%s' is disallowed." % (ch, self.attributes[u"id"]))
+                    raise AttributeError("Router id attribute containing 
character '%s' in id '%s' is disallowed." % (ch, self.attributes["id"]))
         try:
-            self.attributes[u"hostName"] = 
socket.gethostbyaddr(socket.gethostname())[0]
+            self.attributes["hostName"] = 
socket.gethostbyaddr(socket.gethostname())[0]
         except:
-            self.attributes[u"hostName"] = ''
+            self.attributes["hostName"] = ''
         self._qd.qd_dispatch_configure_router(self._dispatch, self)
 
     def __str__(self):
@@ -642,7 +642,7 @@ class HttpConnectorEntity(EntityAdapter):
         self._qd.qd_dispatch_delete_http_connector(self._dispatch, 
self._implementations[0].key)
 
 
-class EntityCache(object):
+class EntityCache:
     """
     Searchable cache of entities, can be refreshed from implementation objects.
     """
@@ -825,7 +825,7 @@ class ManagementEntity(EntityAdapter):
 
     def get_attributes(self, request):
         type = self.requested_type(request)
-        return (OK, dict((t, [a for a in et.attributes])
+        return (OK, dict((t, list(et.attributes))
                          for t, et in self._schema.entity_types.items()
                          if not type or type.name == t))
 
@@ -885,8 +885,8 @@ class ManagementEntity(EntityAdapter):
         raise BadRequestStatus("Bad profile request %s" % (request))
 
 
-class Agent(object):
-    """AMQP managment agent. Manages entities, directs requests to the correct 
entity."""
+class Agent:
+    """AMQP management agent. Manages entities, directs requests to the 
correct entity."""
 
     def __init__(self, dispatch, qd):
         self.qd = qd
diff --git a/python/qpid_dispatch_internal/management/config.py 
b/python/qpid_dispatch_internal/management/config.py
index 5c00ae0..f949d35 100644
--- a/python/qpid_dispatch_internal/management/config.py
+++ b/python/qpid_dispatch_internal/management/config.py
@@ -37,7 +37,7 @@ except ImportError:
     _log_imported = False
 
 
-class Config(object):
+class Config:
     """Load config entities from qdrouterd.conf and validated against 
L{QdSchema}."""
 
     def __init__(self, filename=None, schema=QdSchema(), raw_json=False):
diff --git a/python/qpid_dispatch_internal/management/qdrouter.py 
b/python/qpid_dispatch_internal/management/qdrouter.py
index 67b00b0..2d406ee 100644
--- a/python/qpid_dispatch_internal/management/qdrouter.py
+++ b/python/qpid_dispatch_internal/management/qdrouter.py
@@ -22,8 +22,9 @@ Qpid Dispatch Router management schema and config file 
parsing.
 """
 import json
 from pkgutil import get_data
-from . import schema
+
 from qpid_dispatch_internal.compat import JSON_LOAD_KWARGS
+from . import schema
 
 
 class QdSchema(schema.Schema):
@@ -66,7 +67,7 @@ class QdSchema(schema.Schema):
             # There are 4 roles for listeners - normal, inter-router, 
route-container, edge
             if router_mode and listener_connector_role:
                 # Standalone routers cannot have inter-router or edge 
listeners/connectors
-                if router_mode == "standalone" and (listener_connector_role == 
"inter-router" or listener_connector_role == "edge"):
+                if router_mode == "standalone" and listener_connector_role in 
('inter-router', 'edge'):
                     raise schema.ValidationError(
                         "role='standalone' not allowed to connect to or accept 
connections from other routers.")
 
diff --git a/python/qpid_dispatch_internal/management/schema.py 
b/python/qpid_dispatch_internal/management/schema.py
index 55a75aa..25477d4 100644
--- a/python/qpid_dispatch_internal/management/schema.py
+++ b/python/qpid_dispatch_internal/management/schema.py
@@ -46,7 +46,7 @@ class ValidationError(Exception):
     pass
 
 
-class Type(object):
+class Type:
     """Base class for schema types.
 
     @ivar name: The type name.
@@ -207,7 +207,7 @@ def _dump_dict(items):
     return OrderedDict((k, v) for k, v in items if v)
 
 
-class AttributeType(object):
+class AttributeType:
     """
     Definition of an attribute.
 
@@ -298,7 +298,7 @@ class AttributeType(object):
         return self.name
 
 
-class MessageDef(object):
+class MessageDef:
     """A request or response message"""
 
     def __init__(self, body=None, properties=None):
@@ -309,7 +309,7 @@ class MessageDef(object):
                                for name, value in (properties or {}).items())
 
 
-class OperationDef(object):
+class OperationDef:
     """An operation definition"""
 
     def __init__(self, name, description=None, request=None, response=None):
@@ -326,7 +326,7 @@ class OperationDef(object):
                                   % (name, str(exc), sys.exc_info()[2]))
 
 
-class EntityType(object):
+class EntityType:
     """
     An entity type defines a set of attributes for an entity.
 
@@ -543,7 +543,7 @@ class EntityType(object):
         return self.name == self.schema.long_name(name)
 
 
-class Schema(object):
+class Schema:
     """
     Schema defining entity types.
     Note: keyword arguments come from schema so use camelCase
diff --git a/python/qpid_dispatch_internal/management/schema_doc.py 
b/python/qpid_dispatch_internal/management/schema_doc.py
index 33474dd..442bccf 100644
--- a/python/qpid_dispatch_internal/management/schema_doc.py
+++ b/python/qpid_dispatch_internal/management/schema_doc.py
@@ -24,7 +24,7 @@ import sys
 from .schema import AttributeType
 
 
-class SchemaWriter(object):
+class SchemaWriter:
     """Write the schema as an asciidoc document"""
 
     def __init__(self, output, schema, quiet=True):
diff --git a/python/qpid_dispatch_internal/policy/policy_local.py 
b/python/qpid_dispatch_internal/policy/policy_local.py
index 32c9bb2..4758d52 100644
--- a/python/qpid_dispatch_internal/policy/policy_local.py
+++ b/python/qpid_dispatch_internal/policy/policy_local.py
@@ -17,21 +17,13 @@
 # under the License
 #
 
-"""
+"""Entity implementing the business logic of user connection/access policy."""
 
-"""
 import json
 from .policy_util import PolicyError, HostStruct, HostAddr, 
PolicyAppConnectionMgr, is_ipv6_enabled
 
-"""
-Entity implementing the business logic of user connection/access policy.
-"""
 
-#
-#
-
-
-class PolicyKeys(object):
+class PolicyKeys:
     """
     String constants
     """
@@ -110,7 +102,7 @@ class PolicyKeys(object):
 #
 
 
-class PolicyCompiler(object):
+class PolicyCompiler:
     """
     Validate incoming configuration for legal schema.
     - Warn about section options that go unused.
@@ -180,7 +172,7 @@ class PolicyCompiler(object):
         if v_int < v_min:
             errors.append("Value '%s' is below minimum '%s'." % (val, v_min))
             return False
-        if v_max > 0 and v_int > v_max:
+        if 0 < v_max < v_int:
             errors.append("Value '%s' is above maximum '%s'." % (val, v_max))
             return False
         return True
@@ -311,8 +303,8 @@ class PolicyCompiler(object):
                          PolicyKeys.KW_ALLOW_ADMIN_STATUS_UPDATE
                          ]:
                 if isinstance(val, str) and val.lower() in ['true', 'false']:
-                    val = True if val == 'true' else False
-                if not type(val) is bool:
+                    val = val == 'true'
+                if not isinstance(val, bool):
                     errors.append("Policy vhost '%s' user group '%s' option 
'%s' has illegal boolean value '%s'." %
                                   (vhostname, usergroup, key, val))
                     return False
@@ -454,7 +446,7 @@ class PolicyCompiler(object):
                     return False
                 policy_out[key] = val
             elif key in [PolicyKeys.KW_CONNECTION_ALLOW_DEFAULT]:
-                if not type(val) is bool:
+                if not isinstance(val, bool):
                     errors.append("Policy vhost '%s' option '%s' must be of 
type 'bool' but is '%s'" %
                                   (name, key, type(val)))
                     return False
@@ -476,7 +468,7 @@ class PolicyCompiler(object):
                     val.append(vtest)
                 policy_out[key] = val
             elif key in [PolicyKeys.KW_GROUPS]:
-                if not type(val) is dict:
+                if not isinstance(val, dict):
                     errors.append("Policy vhost '%s' option '%s' must be of 
type 'dict' but is '%s'" %
                                   (name, key, type(val)))
                     return False
@@ -516,7 +508,7 @@ class PolicyCompiler(object):
 
 #
 #
-class AppStats(object):
+class AppStats:
     """
     Maintain live state and statistics for an vhost.
     """
@@ -572,7 +564,7 @@ class AppStats(object):
 #
 
 
-class ConnectionFacts(object):
+class ConnectionFacts:
     def __init__(self, user, host, app, conn_name):
         self.user = user
         self.host = host
@@ -583,7 +575,7 @@ class ConnectionFacts(object):
 #
 
 
-class PolicyLocal(object):
+class PolicyLocal:
     """
     The local policy database.
     """
@@ -770,7 +762,7 @@ class PolicyLocal(object):
         the vhost is defined in rulesetdb.
         @return:
         """
-        return not self._default_vhost == "" and self._default_vhost in 
self.rulesetdb
+        return self._default_vhost != "" and self._default_vhost in 
self.rulesetdb
 
     #
     # Runtime query interface
diff --git a/python/qpid_dispatch_internal/policy/policy_manager.py 
b/python/qpid_dispatch_internal/policy/policy_manager.py
index a102a2f..dd64914 100644
--- a/python/qpid_dispatch_internal/policy/policy_manager.py
+++ b/python/qpid_dispatch_internal/policy/policy_manager.py
@@ -17,9 +17,7 @@
 # under the License
 #
 
-"""
-
-"""
+"""Entity implementing the glue between the policy engine and the rest of the 
system."""
 
 import traceback
 
@@ -27,12 +25,7 @@ from .policy_local import PolicyLocal
 from ..dispatch import LogAdapter, LOG_INFO, LOG_TRACE, LOG_DEBUG, LOG_ERROR, 
LOG_WARNING
 
 
-"""
-Entity implementing the glue between the policy engine and the rest of the 
system.
-"""
-
-
-class PolicyManager(object):
+class PolicyManager:
     """
 
     """
diff --git a/python/qpid_dispatch_internal/policy/policy_util.py 
b/python/qpid_dispatch_internal/policy/policy_util.py
index d10b0e8..f72d8ce 100644
--- a/python/qpid_dispatch_internal/policy/policy_util.py
+++ b/python/qpid_dispatch_internal/policy/policy_util.py
@@ -47,7 +47,7 @@ def is_ipv6_enabled():
     return ipv6_enabled
 
 
-class HostStruct(object):
+class HostStruct:
     """
     HostStruct represents a single, binary socket address from getaddrinfo
         - name     : name given to constructor; numeric IP or host name
@@ -114,7 +114,7 @@ class HostStruct(object):
 #
 
 
-class HostAddr(object):
+class HostAddr:
     """
     Provide HostIP address ranges and comparison functions.
     A HostIP may be:
@@ -205,7 +205,7 @@ class HostAddr(object):
             if len(self.hoststructs) == 1:
                 return c0 == 0
             c1 = self.memcmp(candidate.binary, self.hoststructs[1].binary)
-            return c0 >= 0 and c1 <= 0
+            return c0 >= 0 and c1 <= 0  # pylint: disable=chained-comparison
         except PolicyError:
             return False
         except Exception as e:
@@ -229,7 +229,7 @@ class HostAddr(object):
 #
 
 
-class PolicyAppConnectionMgr(object):
+class PolicyAppConnectionMgr:
     """
     Track policy user/host connection limits and statistics for one app.
     # limits - set at creation and by update()
@@ -340,10 +340,10 @@ class PolicyAppConnectionMgr(object):
         """
         Unregister a connection
         """
-        assert(self.connections_active > 0)
-        assert(user in self.per_user_state)
-        assert(conn_id in self.per_user_state[user])
-        assert(conn_id in self.per_host_state[host])
+        assert self.connections_active > 0
+        assert user in self.per_user_state
+        assert conn_id in self.per_user_state[user]
+        assert conn_id in self.per_host_state[host]
         self.connections_active -= 1
         self.per_user_state[user].remove(conn_id)
         self.per_host_state[host].remove(conn_id)
diff --git a/python/qpid_dispatch_internal/router/address.py 
b/python/qpid_dispatch_internal/router/address.py
index d972bac..c451cdf 100644
--- a/python/qpid_dispatch_internal/router/address.py
+++ b/python/qpid_dispatch_internal/router/address.py
@@ -29,11 +29,11 @@ class Address(str):
     AMQP = "amqp:"
     TOPO = "_topo"
 
-    def __new__(self, addr):  # Subclassing immutable type, must use __new__ 
not __init__
-        if addr.startswith(self.AMQP):
+    def __new__(cls, addr):  # Subclassing immutable type, must use __new__ 
not __init__
+        if addr.startswith(cls.AMQP):
             return str.__new__(addr)
         else:
-            return str.__new__(Address, "%s/%s" % (self.AMQP, addr))
+            return str.__new__(Address, "%s/%s" % (cls.AMQP, addr))
 
     @classmethod
     def mobile(cls, path):
diff --git a/python/qpid_dispatch_internal/router/data.py 
b/python/qpid_dispatch_internal/router/data.py
index c26c119..2dd8035 100644
--- a/python/qpid_dispatch_internal/router/data.py
+++ b/python/qpid_dispatch_internal/router/data.py
@@ -74,7 +74,7 @@ def getIdAndVersion(body):
     return result
 
 
-class LinkState(object):
+class LinkState:
     """
     The link-state of a single router.  The link state consists of a list of 
neighbor routers reachable from
     the reporting router.  The link-state-sequence number is incremented each 
time the link state changes.
@@ -128,7 +128,7 @@ class LinkState(object):
         self.ls_seq += 1
 
 
-class MessageHELLO(object):
+class MessageHELLO:
     """
     HELLO Message
     scope: neighbors only - HELLO messages travel at most one hop
@@ -167,7 +167,7 @@ class MessageHELLO(object):
         return self.seen_peers.count(_id) > 0
 
 
-class MessageRA(object):
+class MessageRA:
     """
     Router Advertisement (RA) Message
     scope: all routers in the area and all designated routers
@@ -207,7 +207,7 @@ class MessageRA(object):
                 'mobile_seq' : self.mobile_seq}
 
 
-class MessageLSU(object):
+class MessageLSU:
     """
     """
 
@@ -243,7 +243,7 @@ class MessageLSU(object):
                 'ls'       : self.ls.to_dict()}
 
 
-class MessageLSR(object):
+class MessageLSR:
     """
     """
 
@@ -269,7 +269,7 @@ class MessageLSR(object):
                 'area'    : self.area}
 
 
-class MessageMAU(object):
+class MessageMAU:
     """
     """
 
@@ -328,7 +328,7 @@ class MessageMAU(object):
         return body
 
 
-class MessageMAR(object):
+class MessageMAR:
     """
     """
 
diff --git a/python/qpid_dispatch_internal/router/engine.py 
b/python/qpid_dispatch_internal/router/engine.py
index 41bfa9b..803f295 100644
--- a/python/qpid_dispatch_internal/router/engine.py
+++ b/python/qpid_dispatch_internal/router/engine.py
@@ -17,6 +17,9 @@
 # under the License.
 #
 
+import time
+from traceback import format_exc, extract_stack
+
 from .data import MessageHELLO, MessageRA, MessageLSU, MessageLSR, \
     isCompatibleVersion, getIdAndVersion
 from .hello import HelloProtocol
@@ -25,8 +28,6 @@ from .path import PathEngine
 from .node import NodeTracker
 from .message import Message
 
-from traceback import format_exc, extract_stack
-import time
 
 ##
 # Import the Dispatch adapters from the environment.  If they are not found
@@ -36,14 +37,15 @@ from ..dispatch import IoAdapter, LogAdapter, LOG_TRACE, 
LOG_INFO, LOG_ERROR, LO
 from ..dispatch import TREATMENT_MULTICAST_FLOOD
 
 
-class RouterEngine(object):
+class RouterEngine:
     """
     """
 
-    def __init__(self, router_adapter, router_id, area, max_routers, 
config_override={}):
+    def __init__(self, router_adapter, router_id, area, max_routers, 
config_override=None):
         """
         Initialize an instance of a router for a domain.
         """
+        config_override = config_override or {}
         ##
         # Record important information about this router instance
         ##
diff --git a/python/qpid_dispatch_internal/router/hello.py 
b/python/qpid_dispatch_internal/router/hello.py
index 51d7a24..7b75471 100644
--- a/python/qpid_dispatch_internal/router/hello.py
+++ b/python/qpid_dispatch_internal/router/hello.py
@@ -21,7 +21,7 @@ from .data import MessageHELLO
 from ..dispatch import LOG_TRACE, LOG_CRITICAL
 
 
-class HelloProtocol(object):
+class HelloProtocol:
     """
     This module is responsible for running the HELLO protocol.
     """
diff --git a/python/qpid_dispatch_internal/router/link.py 
b/python/qpid_dispatch_internal/router/link.py
index a5a203a..e77d899 100644
--- a/python/qpid_dispatch_internal/router/link.py
+++ b/python/qpid_dispatch_internal/router/link.py
@@ -21,7 +21,7 @@ from .data import MessageRA, MessageLSU, MessageLSR
 from ..dispatch import LOG_TRACE
 
 
-class LinkStateEngine(object):
+class LinkStateEngine:
     """
     This module is responsible for running the Link State protocol.
     """
diff --git a/python/qpid_dispatch_internal/router/message.py 
b/python/qpid_dispatch_internal/router/message.py
index 3301a69..4a3435a 100644
--- a/python/qpid_dispatch_internal/router/message.py
+++ b/python/qpid_dispatch_internal/router/message.py
@@ -16,12 +16,13 @@
 # specific language governing permissions and limitations
 # under the License
 #
-import json
 
 """Python class to hold message data"""
 
+import json
+
 
-class Message(object):
+class Message:
     """
     Holder for message attributes used by python IoAdapter send/receive.
 
diff --git a/python/qpid_dispatch_internal/router/node.py 
b/python/qpid_dispatch_internal/router/node.py
index 30d5f8e..90a4938 100644
--- a/python/qpid_dispatch_internal/router/node.py
+++ b/python/qpid_dispatch_internal/router/node.py
@@ -22,7 +22,7 @@ from .data import LinkState, ProtocolVersion
 from .address import Address
 
 
-class NodeTracker(object):
+class NodeTracker:
     """
     This module is responsible for tracking the set of router nodes that are 
known to this
     router.  It tracks whether they are neighbor or remote and whether they 
are reachable.
@@ -59,7 +59,7 @@ class NodeTracker(object):
             "index": 0,
             "protocolVersion": ProtocolVersion,
             "instance": self.container.instance,  # Boot number, integer
-            "linkState": [ls for ls in self.link_state.peers],  # List of 
neighbour nodes
+            "linkState": list(self.link_state.peers),  # List of neighbour 
nodes
             "nextHop": "(self)",
             "validOrigins": [],
             "address": Address.topological(self.my_id, 
area=self.container.area),
@@ -369,7 +369,7 @@ class NodeTracker(object):
             self.next_maskbit = i
 
 
-class RouterNode(object):
+class RouterNode:
     """
     RouterNode is used to track remote routers in the router network.
     """
@@ -403,7 +403,7 @@ class RouterNode(object):
             "index": self.maskbit,
             "protocolVersion": self.version,
             "instance": self.instance,  # Boot number, integer
-            "linkState": [ls for ls in self.link_state.peers],  # List of 
neighbour nodes
+            "linkState": list(self.link_state.peers),  # List of neighbour 
nodes
             "nextHop": self.next_hop_router and self.next_hop_router.id,
             "validOrigins": self.valid_origins,
             "address": Address.topological(self.id, 
area=self.parent.container.area),
diff --git a/python/qpid_dispatch_internal/router/path.py 
b/python/qpid_dispatch_internal/router/path.py
index 4dab1f0..9276d25 100644
--- a/python/qpid_dispatch_internal/router/path.py
+++ b/python/qpid_dispatch_internal/router/path.py
@@ -18,7 +18,7 @@
 #
 
 
-class PathEngine(object):
+class PathEngine:
     """
     This module is responsible for computing the next-hop for every router in 
the domain
     based on the collection of link states that have been gathered.
@@ -159,7 +159,7 @@ class PathEngine(object):
         return next_hops, cost, valid_origins, radius
 
 
-class NodeSet(object):
+class NodeSet:
     """
     This data structure is an ordered list of node IDs, sorted in increasing 
order by their cost.
     Equal cost nodes are secondarily sorted by their ID in order to provide 
deterministic and
diff --git a/python/qpid_dispatch_internal/tools/command.py 
b/python/qpid_dispatch_internal/tools/command.py
index 9eb5886..c01ef59 100644
--- a/python/qpid_dispatch_internal/tools/command.py
+++ b/python/qpid_dispatch_internal/tools/command.py
@@ -36,14 +36,14 @@ class UsageError(Exception):
     pass
 
 
-def main(run, argv=sys.argv, parser=None):
+def main(run, argv=None, parser=None):
     """
     Call run(argv) with exception handling, do appropriate sys.exit().
     @param parser: a Parser to use for usage related error messages.
     @return: exit value for sys.exit
     """
     try:
-        run(argv)
+        run(argv or sys.argv)
         return 0
     except KeyboardInterrupt:
         print()
@@ -237,7 +237,7 @@ def get_password(file=None):
     return None
 
 
-class Sasl(object):
+class Sasl:
     """
     A simple object to hold sasl mechanisms, sasl username and password
     """
diff --git a/python/qpid_dispatch_internal/tools/display.py 
b/python/qpid_dispatch_internal/tools/display.py
index 5653f4a..7c880b6 100644
--- a/python/qpid_dispatch_internal/tools/display.py
+++ b/python/qpid_dispatch_internal/tools/display.py
@@ -133,8 +133,7 @@ class Header:
             if self.format == Header.TIME_SHORT:
                 return TimeShort(value)
             if self.format == Header.DURATION:
-                if value < 0:
-                    value = 0
+                value = max(value, 0)
                 sec = value / 1000000000
                 min = sec / 60
                 hour = min / 60
@@ -290,8 +289,7 @@ class Display:
         return strftime(self.timestampFormat, gmtime(nsec / 1000000000))
 
     def duration(self, nsec):
-        if nsec < 0:
-            nsec = 0
+        nsec = max(nsec, 0)
         sec = nsec / 1000000000
         min = sec / 60
         hour = min / 60
@@ -307,7 +305,7 @@ class Display:
         return result
 
 
-class Sortable(object):
+class Sortable:
     """ """
 
     def __init__(self, row, sortIndex):
diff --git a/src/schema_c.py b/src/schema_c.py
index db8caad..c4bc498 100644
--- a/src/schema_c.py
+++ b/src/schema_c.py
@@ -47,7 +47,7 @@ copyright = """/*
 """
 
 
-class Generator(object):
+class Generator:
 
     def __init__(self):
         self.schema = QdSchema()
@@ -71,7 +71,7 @@ class Generator(object):
 
     def type_name(self, names): return self.prefix_name(names + ['t'])
 
-    class EnumGenerator(object):
+    class EnumGenerator:
         def __init__(self, generator, entity, attribute):
             self.generator, self.entity, self.attribute = generator, entity, 
attribute
             self.tags = attribute.atype.tags
diff --git a/tests/TCP_echo_client.py b/tests/TCP_echo_client.py
index 9bfe5f4..05d58e1 100755
--- a/tests/TCP_echo_client.py
+++ b/tests/TCP_echo_client.py
@@ -165,7 +165,7 @@ class TcpEchoClient:
                                     # Received all bytes of all chunks - done.
                                     self.keep_running = False
                                     # Verify the received data
-                                    if not payload_in == payload_out:
+                                    if payload_in != payload_out:
                                         for idxc in range(self.count):
                                             if not payload_in[idxc] == 
payload_out[idxc]:
                                                 for idxs in range(self.size):
diff --git a/tests/TCP_echo_server.py b/tests/TCP_echo_server.py
index 9866183..db15c02 100755
--- a/tests/TCP_echo_server.py
+++ b/tests/TCP_echo_server.py
@@ -33,7 +33,7 @@ from system_test import Logger
 from system_test import TIMEOUT
 
 
-class ClientRecord(object):
+class ClientRecord:
     """
     Object to register with the selector 'data' field
     for incoming user connections. This is *not* used
diff --git a/tests/friendship_pb2_grpc.py b/tests/friendship_pb2_grpc.py
index 6510b7d..58b3e0f 100644
--- a/tests/friendship_pb2_grpc.py
+++ b/tests/friendship_pb2_grpc.py
@@ -5,7 +5,7 @@ import grpc
 import friendship_pb2 as friendship__pb2
 
 
-class FriendshipStub(object):
+class FriendshipStub:
     """Missing associated documentation comment in .proto file."""
 
     def __init__(self, channel):
@@ -36,7 +36,7 @@ class FriendshipStub(object):
                 )
 
 
-class FriendshipServicer(object):
+class FriendshipServicer:
     """Missing associated documentation comment in .proto file."""
 
     def Create(self, request, context):
@@ -97,7 +97,7 @@ def add_FriendshipServicer_to_server(servicer, server):
 
 
  # This class is part of an EXPERIMENTAL API.
-class Friendship(object):
+class Friendship:
     """Missing associated documentation comment in .proto file."""
 
     @staticmethod
diff --git a/tests/http1_tests.py b/tests/http1_tests.py
index c126cd0..dba13de 100644
--- a/tests/http1_tests.py
+++ b/tests/http1_tests.py
@@ -90,7 +90,7 @@ class RequestHandler(BaseHTTPRequestHandler):
     def log_request(self, code=None, size=None):
         pass
 
-    def log_message(self, format=None, *args):
+    def log_message(self, *args, format=None):
         pass
 
     def _consume_body(self):
@@ -147,7 +147,7 @@ class MyHTTPServer(HTTPServer):
         HTTPServer.server_close(self)
 
 
-class ThreadedTestClient(object):
+class ThreadedTestClient:
     """
     An HTTP client running in a separate thread
     """
@@ -216,7 +216,7 @@ class ThreadedTestClient(object):
         self._logger.dump()
 
 
-class TestServer(object):
+class TestServer:
     """
     A HTTPServer running in a separate thread
     """
@@ -310,7 +310,7 @@ def http1_ping(sport, cport):
     return client.count, client.error
 
 
-class ResponseMsg(object):
+class ResponseMsg:
     """
     A 'hardcoded' HTTP response message.  This class writes its response
     message when called by the HTTPServer via the BaseHTTPRequestHandler
@@ -344,7 +344,7 @@ class ResponseMsg(object):
         handler.wfile.flush()
 
 
-class RequestMsg(object):
+class RequestMsg:
     """
     A 'hardcoded' HTTP request message.  This class writes its request
     message to the HTTPConnection.
@@ -368,7 +368,7 @@ class RequestMsg(object):
             conn.send(self.body)
 
 
-class ResponseValidator(object):
+class ResponseValidator:
     """
     Validate a response as received by the HTTP client
     """
@@ -396,7 +396,7 @@ class ResponseValidator(object):
         return body
 
 
-class CommonHttp1Edge2EdgeTest(object):
+class CommonHttp1Edge2EdgeTest:
     def test_01_concurrent_requests(self):
         """
         Test multiple concurrent clients sending streaming messages
@@ -753,7 +753,7 @@ class CommonHttp1Edge2EdgeTest(object):
         server10.wait()
 
 
-class CommonHttp1OneRouterTest(object):
+class CommonHttp1OneRouterTest:
     TESTS_11 = {
         #
         # GET
@@ -1211,7 +1211,7 @@ class Http1Edge2EdgeTestBase(TestCase):
         cls.http_listener10_port = cls.tester.get_port()
 
 
-class Http1ClientCloseTestsMixIn(object):
+class Http1ClientCloseTestsMixIn:
     """
     Generic test functions for simulating HTTP/1.x client connection drops.
     """
@@ -1367,7 +1367,7 @@ class Http1ClientCloseTestsMixIn(object):
         server.wait()
 
 
-class Http1CurlTestsMixIn(object):
+class Http1CurlTestsMixIn:
     """
     Test cases using curl as the command line client
     """
diff --git a/tests/http2_server.py b/tests/http2_server.py
index 0acb91d..7cad010 100644
--- a/tests/http2_server.py
+++ b/tests/http2_server.py
@@ -16,8 +16,10 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-import system_test
+import json
 import os
+import system_test
+
 from quart import Quart, request
 try:
     from quart.static import send_file
@@ -29,11 +31,10 @@ try:
 except ImportError:
     from werkzeug.exceptions import InternalServerError as HTTPStatusException
 
-import json
 app = Quart(__name__)
 
 
-class MyInfo(object):
+class MyInfo:
     def __init__(self, fname, lname, id=None):
         self.fname = fname
         self.lname = lname
@@ -68,7 +69,7 @@ async def create_myinfo():
 def large_string(length):
     i = 0
     ret_string = ""
-    while (i < length):
+    while i < length:
         ret_string += str(i) + ","
         i += 1
     return ret_string
diff --git a/tests/http2_slow_q2_server.py b/tests/http2_slow_q2_server.py
index 6aa230d..82ef2a6 100644
--- a/tests/http2_slow_q2_server.py
+++ b/tests/http2_slow_q2_server.py
@@ -41,7 +41,7 @@ def send_response(event, conn):
     """
     stream_id = event.stream_id
     conn.send_headers(stream_id=stream_id,
-                      headers=[(u':status', u'200'), (u'server', 
u'h2_slow_q2_server/0.1.0')])
+                      headers=[(':status', '200'), ('server', 
'h2_slow_q2_server/0.1.0')])
     conn.send_data(stream_id=stream_id,
                    data=b'Success!',
                    end_stream=True)
diff --git a/tests/router_engine_test.py b/tests/router_engine_test.py
index 8bef441..d543bd2 100644
--- a/tests/router_engine_test.py
+++ b/tests/router_engine_test.py
@@ -20,7 +20,7 @@
 import os
 import sys
 
-import mock  # noqa F401: imported for side-effects (installs mock definitions 
for tests)
+import mock  # noqa F401: imported for side-effects (installs mock definitions 
for tests)  # pylint: disable=unused-import
 
 sys.path.append(os.path.join(os.environ["SOURCE_DIR"], "python"))
 
@@ -31,7 +31,7 @@ from qpid_dispatch_internal.router.data import LinkState, 
MessageHELLO
 from qpid_dispatch_internal.router.engine import HelloProtocol, PathEngine
 
 
-class Adapter(object):
+class Adapter:
     def __init__(self, domain):
         self._domain = domain
 
@@ -204,7 +204,7 @@ class NeighborTest(unittest.TestCase):
         self.engine.handle_hello(MessageHELLO(None, 'R5', ['R2']), 2.5, 0, 1)
         self.engine.handle_hello(MessageHELLO(None, 'R6', ['R1']), 2.5, 0, 1)
         self.engine.tick(3.0)
-        keys = sorted([k for k in self.neighbors.keys()])
+        keys = sorted(self.neighbors.keys())
         self.assertEqual(keys, ['R2', 'R3', 'R4', 'R6'])
 
 
diff --git a/tests/router_policy_test.py b/tests/router_policy_test.py
index a17480d..9a6d889 100644
--- a/tests/router_policy_test.py
+++ b/tests/router_policy_test.py
@@ -19,13 +19,13 @@
 
 import json
 
-from system_test import unittest
-
 from qpid_dispatch_internal.policy.policy_util import HostAddr, is_ipv6_enabled
 from qpid_dispatch_internal.policy.policy_util import HostStruct
 from qpid_dispatch_internal.policy.policy_util import PolicyError
 from qpid_dispatch_internal.policy.policy_util import PolicyAppConnectionMgr
 from qpid_dispatch_internal.policy.policy_local import PolicyLocal
+
+from system_test import unittest
 from system_test import TestCase, main_module
 
 
@@ -110,7 +110,7 @@ class PolicyHostAddrTest(TestCase):
         self.expect_deny("0:ff:0,0:fe:ffff:ffff::0", "a > b")
 
 
-class QpidDispatch(object):
+class QpidDispatch:
     def qd_dispatch_policy_c_counts_alloc(self):
         return 100
 
@@ -118,7 +118,7 @@ class QpidDispatch(object):
         pass
 
 
-class MockAgent(object):
+class MockAgent:
     def __init__(self):
         self.qd = QpidDispatch()
 
@@ -126,7 +126,7 @@ class MockAgent(object):
         pass
 
 
-class MockPolicyManager(object):
+class MockPolicyManager:
     def __init__(self):
         self.agent = MockAgent()
         self.logs = []
diff --git a/tests/system_test.py b/tests/system_test.py
index 46d3e42..4255554 100755
--- a/tests/system_test.py
+++ b/tests/system_test.py
@@ -309,7 +309,7 @@ class Process(subprocess.Popen):
             error("exit code %s, expected %s" % (status, self.expect))
 
 
-class Config(object):
+class Config:
     """Base class for configuration objects that provide a convenient
     way to create content for configuration files."""
 
@@ -731,7 +731,7 @@ class Qdrouterd(Process):
         return os.path.join(self.outdir, self.logfile)
 
 
-class Tester(object):
+class Tester:
     """Tools for use by TestCase
 - Create a directory for the test.
 - Utilities to create processes and servers, manage ports etc.
@@ -1128,7 +1128,7 @@ class AsyncTestSender(MessagingHandler):
         self._logger.dump()
 
 
-class QdManager(object):
+class QdManager:
     """
     A means to invoke qdmanage during a testcase
     """
@@ -1202,11 +1202,11 @@ class QdManager(object):
         return json.loads(self(cmd))
 
 
-class MgmtMsgProxy(object):
+class MgmtMsgProxy:
     """
     Utility for creating and inspecting management messages
     """
-    class _Response(object):
+    class _Response:
         def __init__(self, status_code, status_description, body):
             self.status_code        = status_code
             self.status_description = status_description
@@ -1305,7 +1305,7 @@ class MgmtMsgProxy(object):
         return Message(properties=ap, reply_to=self.reply_addr)
 
 
-class TestTimeout(object):
+class TestTimeout:
     """
     A callback object for MessagingHandler class
     parent: A MessagingHandler with a timeout() method
@@ -1319,7 +1319,7 @@ class TestTimeout(object):
         self.parent.timeout()
 
 
-class PollTimeout(object):
+class PollTimeout:
     """
     A callback object for MessagingHandler scheduled timers
     parent: A MessagingHandler with a poll_timeout() method
@@ -1370,7 +1370,7 @@ def get_inter_router_links(address):
     return inter_router_links
 
 
-class Timestamp(object):
+class Timestamp:
     """
     Time stamps for logging.
     """
@@ -1382,7 +1382,7 @@ class Timestamp(object):
         return self.ts.strftime("%Y-%m-%d %H:%M:%S.%f")
 
 
-class Logger(object):
+class Logger:
     """
     Record an event log for a self test.
     May print per-event or save events to be printed later.
diff --git a/tests/system_tests_autolinks.py b/tests/system_tests_autolinks.py
index 4427689..33679e4 100644
--- a/tests/system_tests_autolinks.py
+++ b/tests/system_tests_autolinks.py
@@ -18,14 +18,16 @@
 #
 
 import json
+from subprocess import PIPE, STDOUT
 from threading import Timer
+
 from proton import Message
-from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, Process, 
TestTimeout
-from system_test import unittest
 from proton.handlers import MessagingHandler
 from proton.reactor import Container
-from subprocess import PIPE, STDOUT
+
 from qpid_dispatch.management.client import Node
+from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, Process, 
TestTimeout
+from system_test import unittest
 from system_test import QdManager
 
 CONNECTION_PROPERTIES = {'connection': 'properties', 'int_property': 6451}
diff --git a/tests/system_tests_broker.py b/tests/system_tests_broker.py
index 52d982b..a1603c0 100644
--- a/tests/system_tests_broker.py
+++ b/tests/system_tests_broker.py
@@ -22,10 +22,11 @@ System tests involving one or more brokers and dispatch 
routers integrated
 with waypoints.
 """
 
+from itertools import cycle
+
 import system_test
 from system_test import Qdrouterd, message, MISSING_REQUIREMENTS
 from system_test import unittest
-from itertools import cycle
 
 
 class DistributedQueueTest(system_test.TestCase):  # pylint: 
disable=too-many-public-methods
diff --git a/tests/system_tests_connector_status.py 
b/tests/system_tests_connector_status.py
index 138b27f..7c86de0 100644
--- a/tests/system_tests_connector_status.py
+++ b/tests/system_tests_connector_status.py
@@ -17,10 +17,10 @@
 # under the License.
 #
 import json
+from subprocess import PIPE, STDOUT
 from threading import Timer
 
 from system_test import TestCase, Process, Qdrouterd, TIMEOUT
-from subprocess import PIPE, STDOUT
 
 
 class ConnectorStatusTest(TestCase):
diff --git a/tests/system_tests_console.py b/tests/system_tests_console.py
index 60757d8..833b472 100644
--- a/tests/system_tests_console.py
+++ b/tests/system_tests_console.py
@@ -30,7 +30,7 @@ from proton import Message
 from proton.handlers import MessagingHandler
 
 
-class ConsolePreReq(object):
+class ConsolePreReq:
     @staticmethod
     def is_cmd(name):
         ''' determine if a command is present and executes on the system '''
diff --git a/tests/system_tests_core_client.py 
b/tests/system_tests_core_client.py
index 6f09aec..8e0bf36 100644
--- a/tests/system_tests_core_client.py
+++ b/tests/system_tests_core_client.py
@@ -88,7 +88,7 @@ class TestService(MessagingHandler):
     """a service that the core client can communicate with"""
     __test__ = False
 
-    class Timeout(object):
+    class Timeout:
         def __init__(self, service):
             self.service = service
 
@@ -232,7 +232,7 @@ class TestCallTimeout(TestService):
     """test that the timeout is handled properly"""
     __test__ = False
 
-    class PeriodicLogScrape(object):
+    class PeriodicLogScrape:
         # periodically scan the log for the timeout error
         def __init__(self, service):
             self.service = service
diff --git a/tests/system_tests_core_endpoint.py 
b/tests/system_tests_core_endpoint.py
index e1ddec9..5cb9f89 100644
--- a/tests/system_tests_core_endpoint.py
+++ b/tests/system_tests_core_endpoint.py
@@ -18,10 +18,11 @@
 #
 
 from proton import Message
-from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, unittest, 
TestTimeout
 from proton.handlers import MessagingHandler
 from proton.reactor import Container
 
+from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, unittest, 
TestTimeout
+
 
 class RouterTest(TestCase):
 
@@ -32,7 +33,7 @@ class RouterTest(TestCase):
         """Start a router"""
         super(RouterTest, cls).setUpClass()
 
-        def router(name, connection, args=[]):
+        def router(name, connection, args=None):
 
             config = [
                 ('router', {'mode': 'interior', 'id': name}),
@@ -48,7 +49,7 @@ class RouterTest(TestCase):
 
             config = Qdrouterd.Config(config)
 
-            cls.routers.append(cls.tester.qdrouterd(name, config, wait=True, 
cl_args=args))
+            cls.routers.append(cls.tester.qdrouterd(name, config, wait=True, 
cl_args=args or []))
 
         cls.routers = []
         inter_router_port = cls.tester.get_port()
diff --git a/tests/system_tests_delivery_abort.py 
b/tests/system_tests_delivery_abort.py
index 9437f6e..4283b5a 100644
--- a/tests/system_tests_delivery_abort.py
+++ b/tests/system_tests_delivery_abort.py
@@ -18,11 +18,13 @@
 #
 
 from proton import Message
-from system_test import Logger, TestCase, Qdrouterd, main_module, unittest, 
TIMEOUT, TestTimeout, PollTimeout
 from proton.handlers import MessagingHandler
 from proton.reactor import Container
+
 from qpid_dispatch_internal.compat import BINARY
 
+from system_test import Logger, TestCase, Qdrouterd, main_module, unittest, 
TIMEOUT, TestTimeout, PollTimeout
+
 
 class RouterTest(TestCase):
 
@@ -118,7 +120,7 @@ class RouterTest(TestCase):
         self.assertIsNone(test.error)
 
 
-class Entity(object):
+class Entity:
     def __init__(self, status_code, status_description, attrs):
         self.status_code        = status_code
         self.status_description = status_description
@@ -128,7 +130,7 @@ class Entity(object):
         return self.attrs[key]
 
 
-class RouterProxy(object):
+class RouterProxy:
     def __init__(self, reply_addr):
         self.reply_addr = reply_addr
 
diff --git a/tests/system_tests_delivery_counts.py 
b/tests/system_tests_delivery_counts.py
index dfe732f..81917af 100644
--- a/tests/system_tests_delivery_counts.py
+++ b/tests/system_tests_delivery_counts.py
@@ -20,12 +20,14 @@
 from time import sleep
 
 from proton import Message, Delivery
-from system_test import TestCase, Qdrouterd, TIMEOUT, get_link_info, \
-    get_inter_router_links, has_mobile_dest_in_address_table, PollTimeout, 
TestTimeout
 from proton.handlers import MessagingHandler
 from proton.reactor import Container
+
 from qpid_dispatch.management.client import Node
 
+from system_test import TestCase, Qdrouterd, TIMEOUT, get_link_info, \
+    get_inter_router_links, has_mobile_dest_in_address_table, PollTimeout, 
TestTimeout
+
 LARGE_PAYLOAD = ("X" * 1024) * 30
 
 _LINK_STATISTIC_KEYS = {'unsettledCount',
@@ -289,7 +291,7 @@ class TwoRouterReleasedDroppedPresettledTest(TestCase):
         self.two_router_released_dropped_counts(True)
 
 
-class AddressCheckerTimeout (object):
+class AddressCheckerTimeout :
     def __init__(self, parent):
         self.parent = parent
 
@@ -297,7 +299,7 @@ class AddressCheckerTimeout (object):
         self.parent.address_check_timeout()
 
 
-class CounterCheckerTimeout (object):
+class CounterCheckerTimeout :
     def __init__(self, parent):
         self.parent = parent
 
diff --git a/tests/system_tests_distribution.py 
b/tests/system_tests_distribution.py
index 5d63fbe..3f77104 100644
--- a/tests/system_tests_distribution.py
+++ b/tests/system_tests_distribution.py
@@ -20,18 +20,19 @@
 from time import sleep
 
 from proton import Message, Delivery
-from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, TestTimeout
-from system_test import unittest, Logger
 from proton.handlers import MessagingHandler
 from proton.reactor import Container, LinkOption, ApplicationEvent, 
EventInjector
 
+from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, TestTimeout
+from system_test import unittest, Logger
+
 
 # ------------------------------------------------
 # Helper classes for all tests.
 # ------------------------------------------------
 
 
-class AddressCheckResponse(object):
+class AddressCheckResponse:
     """
     Convenience class for the responses returned by an AddressChecker.
     """
@@ -49,7 +50,7 @@ class AddressCheckResponse(object):
             (self.status_code, self.status_description, self.attrs)
 
 
-class AddressChecker (object):
+class AddressChecker:
     """
     Format address-query messages and parse the responses.
     """
@@ -70,7 +71,7 @@ class AddressChecker (object):
         return Message(properties=ap, reply_to=self.reply_addr)
 
 
-class AddressCheckerTimeout (object):
+class AddressCheckerTimeout:
     def __init__(self, parent):
         self.parent = parent
 
@@ -78,7 +79,7 @@ class AddressCheckerTimeout (object):
         self.parent.address_check_timeout()
 
 
-class DistributionSkipMapper(object):
+class DistributionSkipMapper:
     # 1 means skip that test.
     skip = {'test_01': 0,
             'test_02': 0,
@@ -840,11 +841,11 @@ class DistributionTests (TestCase):
 
     @unittest.skipIf(DistributionSkipMapper.skip['test_16'], 'Test skipped 
during development.')
     def test_16_linkroute_linear_all_local(self):
-        name = 'test_16'
         """
         This test should route all senders' link-attaches
         to the local containers on router A.
         """
+        name = 'test_16'
 
         addr_suffix = "addr_16"
 
@@ -927,11 +928,11 @@ class DistributionTests (TestCase):
 
     @unittest.skipIf(DistributionSkipMapper.skip['test_17'], 'Test skipped 
during development.')
     def test_17_linkroute_linear_all_B(self):
-        name = 'test_17'
         """
         This test should route all senders' link-attaches
         to the remote connections on router B.
         """
+        name = 'test_17'
 
         addr_suffix = "addr_17"
 
@@ -1014,11 +1015,11 @@ class DistributionTests (TestCase):
 
     @unittest.skipIf(DistributionSkipMapper.skip['test_18'], 'Test skipped 
during development.')
     def test_18_linkroute_linear_all_C(self):
-        name = 'test_18'
         """
         This test should route all senders' link-attaches
         to the remote connections on router C.
         """
+        name = 'test_18'
 
         addr_suffix = "addr_18"
 
@@ -1101,13 +1102,13 @@ class DistributionTests (TestCase):
 
     @unittest.skipIf(DistributionSkipMapper.skip['test_19'], 'Test skipped 
during development.')
     def test_19_linkroute_linear_kill(self):
-        name = 'test_19'
         """
         Start out as usual, making four senders and seeing their link-attaches
         routed to router A (local). But then kill the two route-container
         connections to router A, and make four more senders.  Their 
link-attaches
         should get routed to router B.
         """
+        name = 'test_19'
 
         addr_suffix = "addr_19"
 
@@ -3563,7 +3564,6 @@ class SerialWaypointTest (MessagingHandler):
              'receiver'   : None,
              'n_received' : 0,
              'queue'      : [],
-             'n_sent'     : 0,
              'name'       : '1'
              },
             {'sender'     : None,
@@ -3571,7 +3571,6 @@ class SerialWaypointTest (MessagingHandler):
              'receiver'   : None,
              'n_received' : 0,
              'queue'      : [],
-             'n_sent'     : 0,
              'name'       : '2'
              }
         ]
@@ -3856,7 +3855,6 @@ class ParallelWaypointTest (MessagingHandler):
              'receiver'   : None,
              'n_received' : 0,
              'queue'      : [],
-             'n_sent'     : 0,
              'name'       : '1'
              },
             {'sender'     : None,
@@ -3864,7 +3862,6 @@ class ParallelWaypointTest (MessagingHandler):
              'receiver'   : None,
              'n_received' : 0,
              'queue'      : [],
-             'n_sent'     : 0,
              'name'       : '2'
              }
         ]
diff --git a/tests/system_tests_drain.py b/tests/system_tests_drain.py
index db46b13..b431edc 100644
--- a/tests/system_tests_drain.py
+++ b/tests/system_tests_drain.py
@@ -17,14 +17,16 @@
 # under the License.
 #
 
+from time import sleep
+
+from proton import Message
+from proton.handlers import MessagingHandler
+from proton.reactor import Container
+
 from system_test import TestCase, Qdrouterd, main_module, TestTimeout, 
unittest, TIMEOUT
 from system_tests_drain_support import DrainMessagesHandler, 
DrainOneMessageHandler
 from system_tests_drain_support import DrainNoMessagesHandler, 
DrainNoMoreMessagesHandler
 from system_tests_drain_support import DrainMessagesMoreHandler
-from proton.handlers import MessagingHandler
-from proton import Message
-from proton.reactor import Container
-from time import sleep
 
 
 class DrainSupportTest(TestCase):
diff --git a/tests/system_tests_drain_support.py 
b/tests/system_tests_drain_support.py
index 247d65a..16ce758 100644
--- a/tests/system_tests_drain_support.py
+++ b/tests/system_tests_drain_support.py
@@ -250,7 +250,7 @@ class DrainMessagesMoreHandler(MessagingHandler):
                    + ", sender_credit:" + str(self.sender.credit))
 
     def printme(self, str):
-        if (self.verbose_printing):
+        if self.verbose_printing:
             print(str + " " + self.show_state())
 
     def timeout(self):
diff --git a/tests/system_tests_dynamic_terminus.py 
b/tests/system_tests_dynamic_terminus.py
index 953dbc2..f35c99d 100644
--- a/tests/system_tests_dynamic_terminus.py
+++ b/tests/system_tests_dynamic_terminus.py
@@ -18,10 +18,11 @@
 #
 
 from proton import Message
-from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, TestTimeout
 from proton.handlers import MessagingHandler
 from proton.reactor import Container, LinkOption
+
 from system_test import unittest
+from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, TestTimeout
 
 
 class RouterTest(TestCase):
diff --git a/tests/system_tests_edge_router.py 
b/tests/system_tests_edge_router.py
index 31e6b29..8cd1f17 100644
--- a/tests/system_tests_edge_router.py
+++ b/tests/system_tests_edge_router.py
@@ -19,11 +19,18 @@
 
 import os
 import re
+from subprocess import PIPE
 from time import sleep
 from threading import Event
 from threading import Timer
 
 from proton import Message
+from proton.handlers import MessagingHandler
+from proton.reactor import Container
+from proton.utils import BlockingConnection
+
+from qpid_dispatch.management.client import Node
+
 from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, 
MgmtMsgProxy, TestTimeout
 from system_test import AsyncTestReceiver
 from system_test import AsyncTestSender
@@ -34,14 +41,9 @@ from system_test import Process
 from system_tests_link_routes import ConnLinkRouteService
 from test_broker import FakeBroker
 from test_broker import FakeService
-from proton.handlers import MessagingHandler
-from proton.reactor import Container
-from proton.utils import BlockingConnection
-from qpid_dispatch.management.client import Node
-from subprocess import PIPE
 
 
-class AddrTimer(object):
+class AddrTimer:
     def __init__(self, parent):
         self.parent = parent
 
@@ -1645,10 +1647,7 @@ class LinkRouteProxyTest(TestCase):
             ts.dump_log()
         return error
 
-    def test_01_immedate_detach_reattach(self):
-        if self.skip['test_01'] :
-            self.skipTest("Test skipped during development.")
-
+    def test_01_immediate_detach_reattach(self):
         """
         Have a service for a link routed address abruptly detach
         in response to an incoming link attach
@@ -1656,6 +1655,9 @@ class LinkRouteProxyTest(TestCase):
         The attaching client from EB1 will get an attach response then an
         immediate detach.  The client will immediately re-establish the link.
         """
+        if self.skip['test_01']:
+            self.skipTest("Test skipped during development.")
+
         class AttachDropper(FakeService):
             def __init__(self, *args, **kwargs):
                 super(AttachDropper, self).__init__(*args, **kwargs)
@@ -2107,7 +2109,7 @@ class DynamicAddressTest(MessagingHandler):
         Container(self).run()
 
 
-class CustomTimeout(object):
+class CustomTimeout:
     def __init__(self, parent):
         self.parent = parent
 
@@ -2335,7 +2337,7 @@ class MobileAddressTest(MessagingHandler):
                 self.n_accepted += 1
                 self.logger.log("on_settled sender: ACCEPTED %d (of %d)" %
                                 (self.n_accepted, self.normal_count))
-            elif rdisp == "RELEASED" or rdisp == "MODIFIED":
+            elif rdisp in ('RELEASED', 'MODIFIED'):
                 self.n_rel_or_mod += 1
                 self.logger.log("on_settled sender: %s %d (of %d)" %
                                 (rdisp, self.n_rel_or_mod, self.extra_count))
@@ -2784,7 +2786,7 @@ class MobileAddressEventTest(MessagingHandler):
     def on_link_opened(self, event):
         if self.r_attaches == 3:
             return
-        if event.receiver == self.receiver1 or event.receiver == 
self.receiver2 or event.receiver == self.receiver3:
+        if event.receiver in (self.receiver1, self.receiver2, self.receiver3):
             self.r_attaches += 1
 
         if self.r_attaches == 3:
diff --git a/tests/system_tests_failover_list.py 
b/tests/system_tests_failover_list.py
index 07fbff8..8db7330 100644
--- a/tests/system_tests_failover_list.py
+++ b/tests/system_tests_failover_list.py
@@ -67,11 +67,11 @@ class RouterTest(TestCase):
 
 
 class FailoverTest(MessagingHandler):
-    def __init__(self, host, count, elements=[]):
+    def __init__(self, host, count, elements=None):
         super(FailoverTest, self).__init__()
         self.host     = host
         self.count    = count
-        self.elements = elements
+        self.elements = elements or []
         self.conn     = None
         self.error    = None
 
diff --git a/tests/system_tests_fallback_dest.py 
b/tests/system_tests_fallback_dest.py
index 1aa0ef3..09b490f 100644
--- a/tests/system_tests_fallback_dest.py
+++ b/tests/system_tests_fallback_dest.py
@@ -17,16 +17,18 @@
 # under the License.
 #
 
+import time
+
 from proton import Message, symbol
+from proton.handlers import MessagingHandler
+from proton.reactor import Container
+
 from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, TestTimeout
 from system_test import unittest, skip_test_in_ci
 from system_test import Logger
-from proton.handlers import MessagingHandler
-from proton.reactor import Container
-import time
 
 
-class AddrTimer(object):
+class AddrTimer:
     def __init__(self, parent):
         self.parent = parent
 
diff --git a/tests/system_tests_grpc.py b/tests/system_tests_grpc.py
index 5377b85..9eed1b1 100644
--- a/tests/system_tests_grpc.py
+++ b/tests/system_tests_grpc.py
@@ -187,8 +187,8 @@ class GrpcServiceMethodsTest(TestCase):
             friends = []
             for friend in self.grpc_stub.ListFriends(pe):
                 friends.append(friend.email)
-            assert(all(f in self.EXP_FRIENDS[key] for f in friends))
-            assert(all(f in friends for f in self.EXP_FRIENDS[key]))
+            assert all(f in self.EXP_FRIENDS[key] for f in friends)
+            assert all(f in friends for f in self.EXP_FRIENDS[key])
 
     @unittest.skipIf(skip_test(), "grpcio is needed to run grpc tests")
     def test_grpc_04_client_stream(self):
@@ -201,5 +201,5 @@ class GrpcServiceMethodsTest(TestCase):
             exp_friends = self.COMMON_FRIENDS_EXP[i]
             res = 
self.grpc_stub.CommonFriendsCount(self.common_friends_list(friends))
             assert res.count == len(exp_friends)
-            assert (all(f in res.friends for f in exp_friends))
-            assert (all(f in exp_friends for f in res.friends))
+            assert all(f in res.friends for f in exp_friends)
+            assert all(f in exp_friends for f in res.friends)
diff --git a/tests/system_tests_heartbeats.py b/tests/system_tests_heartbeats.py
index e5bb859..370dfac 100644
--- a/tests/system_tests_heartbeats.py
+++ b/tests/system_tests_heartbeats.py
@@ -18,12 +18,13 @@
 #
 
 from proton import Message
-from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, unittest, 
TestTimeout
 from proton.handlers import MessagingHandler
 from proton.reactor import Container
 
+from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, unittest, 
TestTimeout
+
 
-class HeartbeatTimer(object):
+class HeartbeatTimer:
     def __init__(self, parent):
         self.parent = parent
 
diff --git a/tests/system_tests_http.py b/tests/system_tests_http.py
index 3be98ff..4d03ee2 100644
--- a/tests/system_tests_http.py
+++ b/tests/system_tests_http.py
@@ -20,13 +20,13 @@ import errno
 import os
 import threading
 import ssl
+from subprocess import PIPE, STDOUT
 
 from urllib.request import urlopen, build_opener, HTTPSHandler
 from urllib.error import HTTPError, URLError
 
 import qpid_dispatch_site
 from system_test import TIMEOUT, Process, QdManager, retry
-from subprocess import PIPE, STDOUT
 from system_test import TestCase, Qdrouterd, main_module, DIR
 from system_test import unittest
 
@@ -214,11 +214,11 @@ class RouterTestHttp(TestCase):
             result = urlopen("http://localhost:%d/metrics"; % port, 
cafile=self.ssl_file('ca-certificate.pem'))
             self.assertEqual(200, result.getcode())
             data = result.read().decode('utf-8')
-            assert('connections' in data)
-            assert('deliveries_ingress' in data)
-            assert('deliveries_delayed_1sec' in data)
-            assert('deliveries_delayed_10sec' in data)
-            assert('deliveries_redirected_to_fallback' in data)
+            assert 'connections' in data
+            assert 'deliveries_ingress' in data
+            assert 'deliveries_delayed_1sec' in data
+            assert 'deliveries_delayed_10sec' in data
+            assert 'deliveries_redirected_to_fallback' in data
 
         # Sequential calls on multiple ports
         for port in r.ports:
diff --git a/tests/system_tests_http1_adaptor.py 
b/tests/system_tests_http1_adaptor.py
index 986a265..49f3153 100644
--- a/tests/system_tests_http1_adaptor.py
+++ b/tests/system_tests_http1_adaptor.py
@@ -433,7 +433,7 @@ class Http1AdaptorEdge2EdgeTest(Http1Edge2EdgeTestBase,
                             self.http_server11_port)
 
 
-class FakeHttpServerBase(object):
+class FakeHttpServerBase:
     """
     A very base socket server to simulate HTTP server behaviors
     """
diff --git a/tests/system_tests_http2.py b/tests/system_tests_http2.py
index e373a17..e163da8 100644
--- a/tests/system_tests_http2.py
+++ b/tests/system_tests_http2.py
@@ -21,15 +21,16 @@ import os
 import sys
 import hashlib
 import unittest
+from subprocess import PIPE
 from time import sleep
+
 import system_test
 from system_test import TestCase, Qdrouterd, QdManager, Process
 from system_test import curl_available, TIMEOUT, skip_test_in_ci
-from subprocess import PIPE
 
 h2hyper_installed = True
 try:
-    import h2.connection # noqa F401: imported but unused
+    import h2.connection # noqa F401: imported but unused  # pylint: 
disable=unused-import
 except ImportError:
     h2hyper_installed = False
 
@@ -133,7 +134,7 @@ class CommonHttp2Tests:
         out = self.run_curl(address)
         i = 0
         ret_string = ""
-        while (i < 1000):
+        while i < 1000:
             ret_string += str(i) + ","
             i += 1
         self.assertIn(ret_string, out)
@@ -227,7 +228,7 @@ class CommonHttp2Tests:
         out = self.run_curl(client_addr)
         ret_string = ""
         i = 0
-        while (i < 1000):
+        while i < 1000:
             ret_string += str(i) + ","
             i += 1
         self.assertIn(ret_string, out)
@@ -317,7 +318,7 @@ class CommonHttp2Tests:
         while tries < num_tries:
             connections = 
qd_manager.query('org.apache.qpid.dispatch.connection')
             tries += 1
-            if (len(connections) < 2):
+            if len(connections) < 2:
                 sleep(2)
             else:
                 conn_present = True
@@ -326,7 +327,7 @@ class CommonHttp2Tests:
         out = self.run_curl(client_addr)
         ret_string = ""
         i = 0
-        while (i < 1000):
+        while i < 1000:
             ret_string += str(i) + ","
             i += 1
         self.assertIn(ret_string, out)
diff --git a/tests/system_tests_interior_sync_up.py 
b/tests/system_tests_interior_sync_up.py
index c674532..e94c676 100644
--- a/tests/system_tests_interior_sync_up.py
+++ b/tests/system_tests_interior_sync_up.py
@@ -24,7 +24,7 @@ from proton.handlers import MessagingHandler
 from proton.reactor import Container
 
 
-class AddrTimer(object):
+class AddrTimer:
     def __init__(self, parent):
         self.parent = parent
 
@@ -75,7 +75,7 @@ class RouterTest(TestCase):
         self.assertIsNone(test.error)
 
 
-class DelayTimeout(object):
+class DelayTimeout:
     def __init__(self, parent):
         self.parent = parent
 
diff --git a/tests/system_tests_link_route_credit.py 
b/tests/system_tests_link_route_credit.py
index b5ab994..1c188a3 100644
--- a/tests/system_tests_link_route_credit.py
+++ b/tests/system_tests_link_route_credit.py
@@ -18,12 +18,13 @@
 #
 
 from proton import Message
-from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, 
TestTimeout, PollTimeout, unittest
 from proton.handlers import MessagingHandler
 from proton.reactor import Container
 
+from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, 
TestTimeout, PollTimeout, unittest
+
 
-class AddrTimer(object):
+class AddrTimer:
     def __init__(self, parent):
         self.parent = parent
 
@@ -308,7 +309,7 @@ class RouterTest(TestCase):
         self.assertIsNone(test.error)
 
 
-class Entity(object):
+class Entity:
     def __init__(self, status_code, status_description, attrs):
         self.status_code        = status_code
         self.status_description = status_description
@@ -318,7 +319,7 @@ class Entity(object):
         return self.attrs[key]
 
 
-class RouterProxy(object):
+class RouterProxy:
     def __init__(self, reply_addr):
         self.reply_addr = reply_addr
 
diff --git a/tests/system_tests_link_routes.py 
b/tests/system_tests_link_routes.py
index 2672ca5..eb8c884 100644
--- a/tests/system_tests_link_routes.py
+++ b/tests/system_tests_link_routes.py
@@ -1416,7 +1416,7 @@ class TerminusAddrTest(MessagingHandler):
 
 
 class MultiLinkSendReceive(MessagingHandler):
-    class SendState(object):
+    class SendState:
         def __init__(self, link):
             self.link = link
             self.sent = False
@@ -1439,7 +1439,7 @@ class MultiLinkSendReceive(MessagingHandler):
                 self.link.close()
                 self.link.connection.close()
 
-    class RecvState(object):
+    class RecvState:
         def __init__(self, link):
             self.link = link
             self.received = False
@@ -2426,7 +2426,7 @@ class ConnLinkRouteService(FakeBroker):
                     pass
 
 
-class ConnLinkRouteMgmtProxy(object):
+class ConnLinkRouteMgmtProxy:
     """
     Manage connection scoped link routes over a given connection.
     While the connection remains open the connection scoped links will remain
@@ -2846,12 +2846,11 @@ class LinkRoute3Hop(TestCase):
         for tx in senders:
             out_text, out_err = tx.communicate(timeout=TIMEOUT)
             if tx.returncode:
-                raise Exception("Sender failed: %s %s" % (out_text, out_err))
+                raise Exception(f"Sender failed: {out_text} {out_err}")
 
         if rx.wait(timeout=TIMEOUT):
-            raise Exception("Receiver failed to consume all messages in=%s 
out=%s",
-                            fake_service.in_count,
-                            fake_service.out_count)
+            raise Exception(
+                f"Receiver failed to consume all messages 
in={fake_service.in_count} out={fake_service.out_count}")
 
         fake_service.join()
         self.assertEqual(total, fake_service.in_count)
diff --git a/tests/system_tests_link_routes_add_external_prefix.py 
b/tests/system_tests_link_routes_add_external_prefix.py
index ea32ed2..0bdd336 100644
--- a/tests/system_tests_link_routes_add_external_prefix.py
+++ b/tests/system_tests_link_routes_add_external_prefix.py
@@ -17,16 +17,16 @@
 # under the License.
 #
 
+import json
 from time import sleep
 from subprocess import PIPE, STDOUT
 
-from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, Process, 
TestTimeout
-from system_test import unittest
-
 from proton import Message
 from proton.handlers import MessagingHandler
 from proton.reactor import Container
-import json
+
+from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, Process, 
TestTimeout
+from system_test import unittest
 
 
 def parse_record(fields, line):
diff --git a/tests/system_tests_log_level_update.py 
b/tests/system_tests_log_level_update.py
index 5e6bfa2..e291d01 100644
--- a/tests/system_tests_log_level_update.py
+++ b/tests/system_tests_log_level_update.py
@@ -17,14 +17,15 @@
 # under the License.
 #
 
-from system_test import TestCase, Qdrouterd
-from system_test import QdManager
-from proton.utils import BlockingConnection
+import time
+
 from proton import Message
+from proton.utils import BlockingConnection
 from proton.reactor import AtMostOnce
 from proton.reactor import Container
 
-import time
+from system_test import TestCase, Qdrouterd
+from system_test import QdManager
 
 apply_options = AtMostOnce()
 
@@ -85,7 +86,7 @@ class ManyLogFilesTest(TestCase):
             with open(self.router.outdir + '/test-router-server.log', 'r') as 
server_log:
                 for line in server_log:
                     parts = line.split(" ")
-                    if (parts[3] != "SERVER"):
+                    if parts[3] != "SERVER":
                         all_server_logs = False
                         break
         except:
@@ -100,7 +101,7 @@ class ManyLogFilesTest(TestCase):
             with open(self.router.outdir + '/test-router-protocol.log', 'r') 
as protocol_log:
                 for line in protocol_log:
                     parts = line.split(" ")
-                    if (parts[3] != "PROTOCOL"):
+                    if parts[3] != "PROTOCOL":
                         all_protocol_logs = False
                         break
         except:
diff --git a/tests/system_tests_log_message_components.py 
b/tests/system_tests_log_message_components.py
index 2d3865f..50e7a74 100644
--- a/tests/system_tests_log_message_components.py
+++ b/tests/system_tests_log_message_components.py
@@ -18,14 +18,17 @@
 #
 
 import json
-from proton import Message, symbol
-from system_test import TestCase, Qdrouterd, Process, TIMEOUT
-from system_test import unittest
 from subprocess import PIPE, STDOUT
+
+from proton import Message, symbol
 from proton.handlers import MessagingHandler
 from proton.reactor import Container
+
 from qpid_dispatch_internal.compat import BINARY
 
+from system_test import TestCase, Qdrouterd, Process, TIMEOUT
+from system_test import unittest
+
 # force streaming in order to check that
 # freeing sent buffers does not lose fields
 # needed by logging
diff --git a/tests/system_tests_management.py b/tests/system_tests_management.py
index 7c6eb18..7d03741 100644
--- a/tests/system_tests_management.py
+++ b/tests/system_tests_management.py
@@ -19,20 +19,24 @@
 
 """System tests for management of qdrouter"""
 
-import system_test
-import re
-import os
 import json
+import os
+import re
+from itertools import chain
+
+from proton import Message
 from proton.handlers import MessagingHandler
 from proton.reactor import Container
-from proton import Message
-from qpid_dispatch.management.client import Node, ManagementError, Url, 
BadRequestStatus, NotImplementedStatus, NotFoundStatus
+
+from qpid_dispatch.management.client import Node, Url
+from qpid_dispatch.management.error import ManagementError, BadRequestStatus, 
NotImplementedStatus, NotFoundStatus
 from qpid_dispatch_internal.management.qdrouter import QdSchema
 from qpid_dispatch_internal.compat import dictify
 from qpid_dispatch_internal.compat import BINARY
+
+import system_test
 from system_test import Qdrouterd, Process
 from system_test import unittest
-from itertools import chain
 
 PREFIX = 'org.apache.qpid.dispatch.'
 MANAGEMENT = PREFIX + 'management'
diff --git a/tests/system_tests_multi_phase.py 
b/tests/system_tests_multi_phase.py
index 29171f0..18de8db 100644
--- a/tests/system_tests_multi_phase.py
+++ b/tests/system_tests_multi_phase.py
@@ -18,12 +18,13 @@
 #
 
 from proton import Message, symbol
-from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, unittest, 
TestTimeout
 from proton.handlers import MessagingHandler
 from proton.reactor import Container
 
+from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, unittest, 
TestTimeout
+
 
-class AddrTimer(object):
+class AddrTimer:
     def __init__(self, parent):
         self.parent = parent
 
diff --git a/tests/system_tests_multi_tenancy.py 
b/tests/system_tests_multi_tenancy.py
index 0c30485..1295e40 100644
--- a/tests/system_tests_multi_tenancy.py
+++ b/tests/system_tests_multi_tenancy.py
@@ -18,11 +18,13 @@
 #
 
 from proton import Message
-from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, unittest, 
TestTimeout, PollTimeout, Logger
 from proton.handlers import MessagingHandler
 from proton.reactor import Container, DynamicNodeProperties
+
 from qpid_dispatch_internal.compat import UNICODE
 
+from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, unittest, 
TestTimeout, PollTimeout, Logger
+
 
 class RouterTest(TestCase):
 
@@ -440,7 +442,7 @@ class RouterTest(TestCase):
         self.assertIsNone(test.error)
 
 
-class Entity(object):
+class Entity:
     def __init__(self, status_code, status_description, attrs):
         self.status_code        = status_code
         self.status_description = status_description
@@ -450,7 +452,7 @@ class Entity(object):
         return self.attrs[key]
 
 
-class RouterProxy(object):
+class RouterProxy:
     def __init__(self, reply_addr):
         self.reply_addr = reply_addr
 
diff --git a/tests/system_tests_multi_tenancy_policy.py 
b/tests/system_tests_multi_tenancy_policy.py
index a2eb567..a5898b8 100644
--- a/tests/system_tests_multi_tenancy_policy.py
+++ b/tests/system_tests_multi_tenancy_policy.py
@@ -18,11 +18,13 @@
 #
 
 from proton import Message
-from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, unittest, 
TestTimeout, PollTimeout, Logger
 from proton.handlers import MessagingHandler
 from proton.reactor import Container, DynamicNodeProperties
+
 from qpid_dispatch_internal.compat import UNICODE
 
+from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, unittest, 
TestTimeout, PollTimeout, Logger
+
 
 class RouterMultitenantPolicyTest(TestCase):
 
@@ -457,7 +459,7 @@ class RouterMultitenantPolicyTest(TestCase):
         self.assertIsNone(test.error)
 
 
-class Entity(object):
+class Entity:
     def __init__(self, status_code, status_description, attrs):
         self.status_code        = status_code
         self.status_description = status_description
@@ -467,7 +469,7 @@ class Entity(object):
         return self.attrs[key]
 
 
-class RouterProxy(object):
+class RouterProxy:
     def __init__(self, reply_addr):
         self.reply_addr = reply_addr
 
diff --git a/tests/system_tests_multicast.py b/tests/system_tests_multicast.py
index e66098a..9df6b9c 100644
--- a/tests/system_tests_multicast.py
+++ b/tests/system_tests_multicast.py
@@ -21,6 +21,7 @@
 # Test the multicast forwarder
 #
 
+import abc
 import sys
 from time import sleep
 
@@ -477,7 +478,7 @@ class Link3Ack(LinkOption):
         link.rcv_settle_mode = Link.RCV_SECOND
 
 
-class MulticastBase(MessagingHandler):
+class MulticastBase(MessagingHandler, metaclass=abc.ABCMeta):
     """
     Common multicast boilerplate code
     """
@@ -531,13 +532,13 @@ class MulticastBase(MessagingHandler):
         self.error = "Timeout Expired"
         self.done()
 
+    @abc.abstractmethod
     def create_receiver(self, container, conn, source, name):
-        # must override in subclass
-        assert(False)
+        """must override in subclass"""
 
+    @abc.abstractmethod
     def create_sender(self, container, conn, target, name):
-        # must override in subclass
-        assert(False)
+        """must override in subclass"""
 
     def on_start(self, event):
         self.reactor = event.reactor
@@ -546,7 +547,7 @@ class MulticastBase(MessagingHandler):
         for cfg in self.config:
             for name in cfg['receivers']:
                 conn = event.container.connect(cfg['router'].listener)
-                assert(name not in self.r_conns)
+                assert name not in self.r_conns
                 self.r_conns[name] = conn
                 self.create_receiver(event.container, conn, self.topic, name)
                 self.n_receivers += 1
@@ -562,7 +563,7 @@ class MulticastBase(MessagingHandler):
                 for cfg in self.config:
                     for name in cfg['senders']:
                         conn = event.container.connect(cfg['router'].listener)
-                        assert(name not in self.s_conns)
+                        assert name not in self.s_conns
                         self.s_conns[name] = conn
                         self.create_sender(event.container, conn, self.topic, 
name)
                         self.n_senders += 1
@@ -916,7 +917,7 @@ class MulticastUnsettled3AckMA(MulticastUnsettled3Ack):
             "my-map": {"my-map-key1": "X",
                        "my-map-key2": 0x12,
                        "my-map-key3": "+0123456789" * 101,
-                       "my-map-list": [i for i in range(97)]
+                       "my-map-list": list(range(97))
                        },
             "my-last-key": "so long, folks!"
         }
diff --git a/tests/system_tests_one_router.py b/tests/system_tests_one_router.py
index 9b74e29..8da2ebc 100644
--- a/tests/system_tests_one_router.py
+++ b/tests/system_tests_one_router.py
@@ -17,19 +17,20 @@
 # under the License.
 #
 
-from proton import Condition, Message, Delivery, Url, symbol, Timeout
-from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, DIR, 
Process, unittest, QdManager, TestTimeout
-from proton.handlers import MessagingHandler, TransactionHandler
-from proton.reactor import Container, AtMostOnce, AtLeastOnce
-from proton.utils import BlockingConnection, SyncRequestResponse
-from proton import VERSION as PROTON_VERSION
-from proton import Terminus
-from proton import Data, symbol
-from qpid_dispatch.management.client import Node
-import os
 import json
+import os
 from subprocess import PIPE, STDOUT
 from time import sleep
+
+from proton import Condition, Data, Delivery, Message, Terminus, Timeout, Url, 
symbol
+from proton import VERSION as PROTON_VERSION
+from proton.handlers import MessagingHandler, TransactionHandler
+from proton.utils import BlockingConnection, SyncRequestResponse
+from proton.reactor import Container, AtMostOnce, AtLeastOnce
+
+from qpid_dispatch.management.client import Node
+
+from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, DIR, 
Process, unittest, QdManager, TestTimeout
 from test_broker import FakeBroker
 
 
@@ -744,14 +745,14 @@ class OneRouterTest(TestCase):
             # check the caps sent by router.
             self.assertTrue(test.remote_offered is not None)
             self.assertTrue(test.remote_desired is not None)
-            ro = [c for c in test.remote_offered]
-            rd = [c for c in test.remote_desired]
+            ro = list(test.remote_offered)
+            rd = list(test.remote_desired)
             for rc in [ro, rd]:
                 self.assertIn(symbol('ANONYMOUS-RELAY'), rc)
                 self.assertIn(symbol('qd.streaming-links'), rc)
 
 
-class Entity(object):
+class Entity:
     def __init__(self, status_code, status_description, attrs):
         self.status_code        = status_code
         self.status_description = status_description
@@ -761,7 +762,7 @@ class Entity(object):
         return self.attrs[key]
 
 
-class RouterProxy(object):
+class RouterProxy:
     def __init__(self, reply_addr):
         self.reply_addr = reply_addr
 
@@ -796,7 +797,7 @@ class RouterProxy(object):
         return Message(properties=ap, reply_to=self.reply_addr)
 
 
-class ReleasedChecker(object):
+class ReleasedChecker:
     def __init__(self, parent):
         self.parent = parent
 
@@ -1295,7 +1296,7 @@ class ManagementTest(MessagingHandler):
         Container(self).run()
 
 
-class CustomTimeout(object):
+class CustomTimeout:
     def __init__(self, parent):
         self.parent = parent
 
@@ -1461,7 +1462,7 @@ class PreSettled (MessagingHandler) :
             self.bail(None)
 
 
-class PresettledCustomTimeout(object):
+class PresettledCustomTimeout:
     def __init__(self, parent):
         self.parent = parent
         self.num_tries = 0
@@ -2886,7 +2887,7 @@ class MultiframePresettledTest(MessagingHandler):
         Container(self).run()
 
 
-class UptimeLastDlvChecker(object):
+class UptimeLastDlvChecker:
     def __init__(self, parent, lastDlv=None, uptime=0):
         self.parent = parent
         self.uptime = uptime
diff --git a/tests/system_tests_policy.py b/tests/system_tests_policy.py
index 2887b23..2c62b02 100644
--- a/tests/system_tests_policy.py
+++ b/tests/system_tests_policy.py
@@ -17,20 +17,22 @@
 # under the License.
 #
 
-import unittest as unittest
+import unittest
 import os
 import json
 import re
 import sys
 import time
+from subprocess import PIPE, STDOUT
 
 from system_test import TestCase, Qdrouterd, main_module, Process, TIMEOUT, 
DIR, TestTimeout
 from system_test import Logger
-from subprocess import PIPE, STDOUT
+
 from proton import ConnectionException, Timeout, Url, symbol
 from proton.handlers import MessagingHandler
 from proton.reactor import Container, ReceiverOption
 from proton.utils import BlockingConnection, LinkDetached, SyncRequestResponse
+
 from qpid_dispatch_internal.policy.policy_util import is_ipv6_enabled
 from test_broker import FakeBroker
 
diff --git a/tests/system_tests_policy_oversize_compound.py 
b/tests/system_tests_policy_oversize_compound.py
index 177b2b9..02dd0d4 100644
--- a/tests/system_tests_policy_oversize_compound.py
+++ b/tests/system_tests_policy_oversize_compound.py
@@ -20,12 +20,13 @@
 import unittest
 import sys
 import time
-
-from system_test import TestCase, Qdrouterd, main_module, Process, TIMEOUT, 
Logger, TestTimeout
 from subprocess import PIPE, STDOUT
+
 from proton import Message
 from proton.handlers import MessagingHandler
 from proton.reactor import Container
+
+from system_test import TestCase, Qdrouterd, main_module, Process, TIMEOUT, 
Logger, TestTimeout
 from test_broker import FakeBroker
 
 # How many worker threads?
@@ -802,7 +803,7 @@ class MaxMessageSizeBlockOversize(TestCase):
         idelta = iafter - ibefore
         odelta = oafter - obefore
         success = odelta == 0 and idelta == 1
-        if (not success):
+        if not success:
             test.logger.log("FAIL: N closed events in log file did not 
increment by 1. oBefore: %d, oAfter: %d, iBefore:%d, iAfter:%d" %
                             (obefore, oafter, ibefore, iafter))
             test.logger.dump()
@@ -811,7 +812,7 @@ class MaxMessageSizeBlockOversize(TestCase):
         # Verfiy that a link was closed with the expected pattern(s)
         ilink1, olink1 = self.sense_n_closed_lines(self.EB1, 
pattern=OVERSIZE_LINK_CONDITION_NAME)
         success = olink1 > 0
-        if (not success):
+        if not success:
             test.logger.log("FAIL: Did not see link close in log file. 
oBefore: %d, oAfter: %d, iBefore:%d, iAfter:%d" %
                             (obefore, oafter, ibefore, iafter))
             test.logger.dump()
@@ -850,7 +851,7 @@ class MaxMessageSizeBlockOversize(TestCase):
         idelta = iafter - ibefore
         odelta = oafter - obefore
         success = odelta == 0 and idelta == 1
-        if (not success):
+        if not success:
             test.logger.log("FAIL: N closed events in log file did not 
increment by 1. oBefore: %d, oAfter: %d, iBefore:%d, iAfter:%d" %
                             (obefore, oafter, ibefore, iafter))
             test.logger.dump()
@@ -894,8 +895,8 @@ class MaxMessageSizeBlockOversize(TestCase):
         iafter, oafter = self.sense_n_closed_lines(self.EB1)
         idelta = iafter - ibefore
         odelta = oafter - obefore
-        success = odelta == 1 and (idelta == 0 or idelta == 1)
-        if (not success):
+        success = odelta == 1 and idelta in (0, 1)
+        if not success:
             test.logger.log("FAIL: N closed events in log file did not 
increment by 1. oBefore: %d, oAfter: %d, iBefore:%d, iAfter:%d" %
                             (obefore, oafter, ibefore, iafter))
             test.logger.dump()
@@ -945,7 +946,7 @@ class MaxMessageSizeBlockOversize(TestCase):
         idelta = iafter - ibefore
         odelta = oafter - obefore
         success = odelta == 0 and idelta == 1
-        if (not success):
+        if not success:
             test.logger.log("FAIL: N closed events in log file did not 
increment by 1. oBefore: %d, oAfter: %d, iBefore:%d, iAfter:%d" %
                             (obefore, oafter, ibefore, iafter))
             test.logger.dump()
@@ -995,7 +996,7 @@ class MaxMessageSizeBlockOversize(TestCase):
         idelta = iafter - ibefore
         odelta = oafter - obefore
         success = odelta == 1 and idelta == 0
-        if (not success):
+        if not success:
             test.logger.log("FAIL: N closed events in log file did not 
increment by 1. oBefore: %d, oAfter: %d, iBefore:%d, iAfter:%d" %
                             (obefore, oafter, ibefore, iafter))
             test.logger.dump()
@@ -1045,7 +1046,7 @@ class MaxMessageSizeBlockOversize(TestCase):
         idelta = iafter - ibefore
         odelta = oafter - obefore
         success = odelta == 1 and idelta == 0
-        if (not success):
+        if not success:
             test.logger.log(
                 "FAIL: N closed events in log file did not increment by 1. 
oBefore: %d, oAfter: %d, iBefore:%d, iAfter:%d" %
                 (obefore, oafter, ibefore, iafter))
@@ -1253,8 +1254,8 @@ class MaxMessageSizeLinkRouteOversize(TestCase):
         iafter, oafter = self.sense_n_closed_lines(self.EB1)
         idelta = iafter - ibefore
         odelta = oafter - obefore
-        success = odelta == 1 and (idelta == 0 or idelta == 1)
-        if (not success):
+        success = odelta == 1 and idelta in (0, 1)
+        if not success:
             test.logger.log("FAIL: N closed events in log file did not 
increment by 1. oBefore: %d, oAfter: %d, iBefore:%d, iAfter:%d" %
                             (obefore, oafter, ibefore, iafter))
             test.logger.dump()
diff --git a/tests/system_tests_priority.py b/tests/system_tests_priority.py
index e50fc84..70e42f9 100644
--- a/tests/system_tests_priority.py
+++ b/tests/system_tests_priority.py
@@ -19,18 +19,19 @@
 
 
 from proton import Message, Timeout
-from system_test import TestCase, Qdrouterd, main_module, unittest
 from proton.handlers import MessagingHandler
 from proton.reactor import Container
 
 from qpid_dispatch_internal.compat import UNICODE
 
+from system_test import TestCase, Qdrouterd, main_module, unittest
+
 # ------------------------------------------------
 # Helper classes for all tests.
 # ------------------------------------------------
 
 
-class Timeout(object):
+class Timeout:
     """
     Named timeout object can handle multiple simultaneous
     timers, by telling the parent which one fired.
@@ -44,7 +45,7 @@ class Timeout(object):
         self.parent.timeout(self.name)
 
 
-class ManagementMessageHelper (object):
+class ManagementMessageHelper:
     """
     Format management messages.
     """
diff --git a/tests/system_tests_qdmanage.py b/tests/system_tests_qdmanage.py
index f6dd37a..c7fad58 100644
--- a/tests/system_tests_qdmanage.py
+++ b/tests/system_tests_qdmanage.py
@@ -20,14 +20,16 @@
 import json
 import os
 import sys
+from subprocess import PIPE, STDOUT
 from time import sleep
 
-from system_test import Logger, TestCase, Process, Qdrouterd, main_module, 
TIMEOUT, DIR
-from system_test import unittest
-from subprocess import PIPE, STDOUT
+from proton.utils import BlockingConnection
+
 from qpid_dispatch_internal.compat import dictify
 from qpid_dispatch_internal.management.qdrouter import QdSchema
-from proton.utils import BlockingConnection
+
+from system_test import unittest
+from system_test import Logger, TestCase, Process, Qdrouterd, main_module, 
TIMEOUT, DIR
 from system_test import QdManager
 
 DUMMY = "org.apache.qpid.dispatch.dummy"
diff --git a/tests/system_tests_qdstat.py b/tests/system_tests_qdstat.py
index efc8772..80afcdb 100644
--- a/tests/system_tests_qdstat.py
+++ b/tests/system_tests_qdstat.py
@@ -21,10 +21,12 @@ import os
 import re
 import unittest
 from subprocess import PIPE
+
 from proton import Url, SSLDomain, SSLUnavailable, SASL
-from system_test import main_module, TIMEOUT, TestCase, Qdrouterd, DIR
 from proton.utils import BlockingConnection
 
+from system_test import main_module, TIMEOUT, TestCase, Qdrouterd, DIR
+
 
 class QdstatTestBase(TestCase):
     """Define run_qdstat for use with all tests"""
@@ -888,7 +890,7 @@ class QdstatSslTest(QdstatTestBase):
 
     def test_ssl_peer_name_verify_disabled(self):
         """Verify the --ssl-disable-peer-name-verify option"""
-        params = [x for x in self.get_ssl_args()['trustfile']]
+        params = self.get_ssl_args()['trustfile']
 
         # Expect the connection to fail, since the certificate has
         # 'localhost' as the peer name and we used '127.0.0.1' instead.
diff --git a/tests/system_tests_routing_protocol.py 
b/tests/system_tests_routing_protocol.py
index 2e17fb3..552baa7 100644
--- a/tests/system_tests_routing_protocol.py
+++ b/tests/system_tests_routing_protocol.py
@@ -18,11 +18,12 @@
 #
 
 from proton import Message, symbol, int32
-from system_test import TestCase, Qdrouterd, main_module, TIMEOUT
-from system_test import unittest, TestTimeout
 from proton.handlers import MessagingHandler
 from proton.reactor import Container
 
+from system_test import TestCase, Qdrouterd, main_module, TIMEOUT
+from system_test import unittest, TestTimeout
+
 
 class RouterTest(TestCase):
 
diff --git a/tests/system_tests_ssl.py b/tests/system_tests_ssl.py
index 1e78eae..196a910 100644
--- a/tests/system_tests_ssl.py
+++ b/tests/system_tests_ssl.py
@@ -25,15 +25,17 @@ import ssl
 import sys
 import re
 import time
+from distutils.version import StrictVersion
 from subprocess import Popen, PIPE
+
+import cproton
+import proton
+from proton import SASL, Url, SSLDomain, SSLUnavailable
+from proton.utils import BlockingConnection
+
 from qpid_dispatch.management.client import Node
 from system_test import TestCase, main_module, Qdrouterd, DIR
 from system_test import unittest
-from proton import SASL, Url, SSLDomain, SSLUnavailable
-from proton.utils import BlockingConnection
-from distutils.version import StrictVersion
-import proton
-import cproton
 
 
 class RouterTestSslBase(TestCase):
@@ -133,9 +135,9 @@ class RouterTestSslClient(RouterTestSslBase):
     OPENSSL_HAS_TLSV1_3 = False
     if OPENSSL_VER_1_1_GT:
         try:
-            ssl.TLSVersion.TLSv1_3
+            _ = ssl.TLSVersion.TLSv1_3
             OPENSSL_HAS_TLSV1_3 = True
-        except:
+        except AttributeError:
             pass
 
     # Test if Proton supports TLSv1_3
diff --git a/tests/system_tests_stuck_deliveries.py 
b/tests/system_tests_stuck_deliveries.py
index da6ecb6..4c7cfa5 100644
--- a/tests/system_tests_stuck_deliveries.py
+++ b/tests/system_tests_stuck_deliveries.py
@@ -18,13 +18,14 @@
 #
 
 from proton import Message
-from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, 
MgmtMsgProxy, TestTimeout, PollTimeout
-from system_test import unittest
 from proton.handlers import MessagingHandler
 from proton.reactor import Container
 
+from system_test import unittest
+from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, 
MgmtMsgProxy, TestTimeout, PollTimeout
+
 
-class AddrTimer(object):
+class AddrTimer:
     def __init__(self, parent):
         self.parent = parent
 
@@ -41,7 +42,7 @@ class RouterTest(TestCase):
         """Start a router"""
         super(RouterTest, cls).setUpClass()
 
-        def router(name, mode, connection, extra=None, args=[]):
+        def router(name, mode, connection, extra=None, args=None):
             config = [
                 ('router', {'mode': mode, 'id': name}),
                 ('listener', {'port': cls.tester.get_port(), 
'stripAnnotations': 'no'}),
@@ -51,7 +52,7 @@ class RouterTest(TestCase):
             if extra:
                 config.append(extra)
             config = Qdrouterd.Config(config)
-            cls.routers.append(cls.tester.qdrouterd(name, config, wait=True, 
cl_args=args))
+            cls.routers.append(cls.tester.qdrouterd(name, config, wait=True, 
cl_args=args or []))
 
         cls.routers = []
 
diff --git a/tests/system_tests_tcp_adaptor.py 
b/tests/system_tests_tcp_adaptor.py
index 1b0be7f..84adb40 100644
--- a/tests/system_tests_tcp_adaptor.py
+++ b/tests/system_tests_tcp_adaptor.py
@@ -24,6 +24,8 @@ import socket
 import sys
 import time
 import traceback
+from subprocess import PIPE
+from subprocess import STDOUT
 
 from system_test import Logger
 from system_test import main_module
@@ -33,9 +35,6 @@ from system_test import TestCase
 from system_test import TIMEOUT
 from system_test import unittest
 
-from subprocess import PIPE
-from subprocess import STDOUT
-
 # Tests in this file are organized by classes that inherit TestCase.
 # The first instance is TcpAdaptor(TestCase).
 # The tests emit files that are named starting with 'TcpAdaptor'. This includes
@@ -47,17 +46,17 @@ try:
     from TCP_echo_client import TcpEchoClient
     from TCP_echo_server import TcpEchoServer
 except ImportError:
-    class TCP_echo_client(object):
+    class TCP_echo_client:
         pass
 
-    class TCP_echo_server(object):
+    class TCP_echo_server:
         pass
 
 
 DISABLE_SELECTOR_TESTS = False
 DISABLE_SELECTOR_REASON = ''
 try:
-    import selectors  # noqa F401: imported but unused (echo server and echo 
client import this, they run as subprocesses)
+    import selectors  # noqa F401: imported but unused (echo server and echo 
client import this, they run as subprocesses)  # pylint: disable=unused-import
 except ImportError:
     DISABLE_SELECTOR_TESTS = True
     DISABLE_SELECTOR_REASON = "Python selectors module is not available on 
this platform."
@@ -931,8 +930,8 @@ class TcpAdaptor(TestCase):
         logger.log(name + " Start")
         out = 
self.run_ncat(TcpAdaptor.tcp_client_listener_ports[client][server], logger, 
data=b'abcd')
         logger.log("run_ncat returns: '%s'" % out)
-        assert(len(out) > 0)
-        assert("abcd" in out)
+        assert len(out) > 0
+        assert "abcd" in out
         logger.log(tname + " Stop")
 
     # half-closed handling
@@ -961,20 +960,20 @@ class TcpAdaptor(TestCase):
         for output in outputs:
             if output['name'].startswith("ES"):
                 # Check only echo server listeners
-                assert("connectionsOpened" in output)
-                assert(output["connectionsOpened"] > 0)
-                assert(output["connectionsOpened"] == 
output["connectionsClosed"])
-                assert(output["bytesIn"] == output["bytesOut"])
+                assert "connectionsOpened" in output
+                assert output["connectionsOpened"] > 0
+                assert output["connectionsOpened"] == 
output["connectionsClosed"]
+                assert output["bytesIn"] == output["bytesOut"]
         # Verify connector stats
         query_command = 'QUERY --type=tcpConnector'
         outputs = json.loads(self.run_qdmanage(query_command))
         for output in outputs:
-            assert(output['address'].startswith("ES"))
-            assert("connectionsOpened" in output)
-            assert(output["connectionsOpened"] > 0)
+            assert output['address'].startswith("ES")
+            assert "connectionsOpened" in output
+            assert output["connectionsOpened"] > 0
             # egress_dispatcher connection opens and should never close
-            assert(output["connectionsOpened"] == output["connectionsClosed"] 
+ 1)
-            assert(output["bytesIn"] == output["bytesOut"])
+            assert output["connectionsOpened"] == output["connectionsClosed"] 
+ 1
+            assert output["bytesIn"] == output["bytesOut"]
         self.logger.log(tname + " SUCCESS")
 
 
@@ -1233,10 +1232,10 @@ class TcpAdaptorManagementTest(TestCase):
             time.sleep(0.25)
 
         # Delete the connector and listener
-        out = mgmt.delete(type=CONNECTOR_TYPE, name=connector_name)
+        out = mgmt.delete(type=CONNECTOR_TYPE, name=connector_name)  # pylint: 
disable=assignment-from-no-return
         self.assertIsNone(out)
         self.assertEqual(0, len(mgmt.query(type=CONNECTOR_TYPE).results))
-        out = mgmt.delete(type=LISTENER_TYPE, name=listener_name)
+        out = mgmt.delete(type=LISTENER_TYPE, name=listener_name)  # pylint: 
disable=assignment-from-no-return
         self.assertIsNone(out)
         self.assertEqual(0, len(mgmt.query(type=LISTENER_TYPE).results))
 
diff --git a/tests/system_tests_topology.py b/tests/system_tests_topology.py
index ae2fc43..c10122b 100644
--- a/tests/system_tests_topology.py
+++ b/tests/system_tests_topology.py
@@ -17,22 +17,23 @@
 # under the License.
 #
 
+import time
+
 from proton import Message, Timeout
+from proton.handlers import MessagingHandler
+from proton.reactor import Container
+
 from system_test import AsyncTestReceiver
 from system_test import TestCase, Qdrouterd, main_module
 from system_test import TIMEOUT
 from system_test import unittest
-from proton.handlers import MessagingHandler
-from proton.reactor import Container
-
-import time
 
 # ------------------------------------------------
 # Helper classes for all tests.
 # ------------------------------------------------
 
 
-class Timeout(object):
+class Timeout:
     """
     Named timeout object can handle multiple simultaneous
     timers, by telling the parent which one fired.
@@ -46,7 +47,7 @@ class Timeout(object):
         self.parent.timeout(self.name)
 
 
-class ManagementMessageHelper (object):
+class ManagementMessageHelper:
     """
     Format management messages.
     """
@@ -480,9 +481,10 @@ class TopologyFailover (MessagingHandler):
 
     def on_message(self, event):
 
-        if event.receiver == self.routers['B']['mgmt_receiver'] or \
-           event.receiver == self.routers['C']['mgmt_receiver'] or \
-           event.receiver == self.routers['D']['mgmt_receiver'] :
+        if event.receiver in (
+                self.routers['B']['mgmt_receiver'],
+                self.routers['C']['mgmt_receiver'],
+                self.routers['D']['mgmt_receiver']):
 
             # ----------------------------------------------------------------
             # This is a management message.
diff --git a/tests/system_tests_topology_addition.py 
b/tests/system_tests_topology_addition.py
index 0308b73..5972425 100644
--- a/tests/system_tests_topology_addition.py
+++ b/tests/system_tests_topology_addition.py
@@ -20,10 +20,11 @@
 import unittest
 
 from proton import Message, Timeout
-from system_test import TestCase, Qdrouterd, main_module, TIMEOUT
 from proton.handlers import MessagingHandler
 from proton.reactor import Container
 
+from system_test import TestCase, Qdrouterd, main_module, TIMEOUT
+
 
 # ====================================================
 # Helper classes for all tests.
@@ -32,7 +33,7 @@ from proton.reactor import Container
 
 # Named timers allow test code to distinguish between several
 # simultaneous timers, going off at different rates.
-class Timeout (object):
+class Timeout:
     def __init__(self, parent, name):
         self.parent = parent
         self.name   = name
diff --git a/tests/system_tests_topology_disposition.py 
b/tests/system_tests_topology_disposition.py
index b95a51d..2f7aadd 100644
--- a/tests/system_tests_topology_disposition.py
+++ b/tests/system_tests_topology_disposition.py
@@ -36,7 +36,7 @@ from system_test import TestCase, Qdrouterd, main_module
 # Helper classes for all tests.
 # ================================================
 
-class Stopwatch (object) :
+class Stopwatch:
 
     def __init__(self, name, timer, initial_time, repeat_time) :
         self.name         = name
@@ -45,7 +45,7 @@ class Stopwatch (object) :
         self.repeat_time  = repeat_time
 
 
-class Timeout(object):
+class Timeout:
     """
     Named timeout object can handle multiple simultaneous
     timers, by telling the parent which one fired.
@@ -59,7 +59,7 @@ class Timeout(object):
         self.parent.timeout(self.name)
 
 
-class ManagementMessageHelper (object) :
+class ManagementMessageHelper:
     """
     Format management messages.
     """
@@ -855,7 +855,7 @@ class TopologyDisposition (MessagingHandler):
             return
         elif name == 'sender':
             if self.state == 'sending' :
-                if not (self.timeout_count % 20):
+                if not self.timeout_count % 20:
                     if self.kill_count < len(self.kill_list):
                         self.kill_a_connector(self.kill_list[self.kill_count])
                         self.kill_count += 1
@@ -973,10 +973,7 @@ class TopologyDisposition (MessagingHandler):
         # ----------------------------------------------------------------
         # Is this a management message?
         # ----------------------------------------------------------------
-        if event.receiver == self.routers['A']['mgmt_receiver'] or \
-           event.receiver == self.routers['B']['mgmt_receiver'] or \
-           event.receiver == self.routers['C']['mgmt_receiver'] or \
-           event.receiver == self.routers['D']['mgmt_receiver'] :
+        if event.receiver in (router['mgmt_receiver'] for router in 
self.routers.values()):
 
             if self.state == 'topo checking' :
                 # In the 'topo checking' state, we send management messages to
@@ -997,7 +994,7 @@ class TopologyDisposition (MessagingHandler):
                         self.state_transition('topo check successful', 'link 
checking')
                         self.check_links()
 
-            elif self.state == 'link checking' or self.state == 'post mortem' :
+            elif self.state in ('link checking', 'post mortem'):
                 # Link checking was used during initial debugging of this test,
                 # to visually check on the number of undelivered and unsettled
                 # messages in each link, especially during the "post mortem"
diff --git a/tests/system_tests_two_routers.py 
b/tests/system_tests_two_routers.py
index 5c589dc..a48f1b7 100644
--- a/tests/system_tests_two_routers.py
+++ b/tests/system_tests_two_routers.py
@@ -17,13 +17,21 @@
 # under the License.
 #
 
-from time import sleep
 import json
 import os
 import logging
+from time import sleep
 from threading import Timer
 from subprocess import PIPE, STDOUT
+
+from proton import Described, ulong
 from proton import Message, Delivery, symbol, Condition
+from proton.handlers import MessagingHandler
+from proton.reactor import Container, AtLeastOnce
+from proton.utils import BlockingConnection
+
+from qpid_dispatch.management.client import Node
+
 from system_test import Logger, TestCase, Process, Qdrouterd, main_module, 
TIMEOUT, DIR, TestTimeout, PollTimeout
 from system_test import AsyncTestReceiver
 from system_test import AsyncTestSender
@@ -31,12 +39,6 @@ from system_test import get_inter_router_links
 from system_test import unittest
 from test_broker import FakeService
 
-from proton import Described, ulong
-
-from proton.handlers import MessagingHandler
-from proton.reactor import Container, AtLeastOnce
-from proton.utils import BlockingConnection
-from qpid_dispatch.management.client import Node
 CONNECTION_PROPERTIES_UNICODE_STRING = {'connection': 'properties', 
'int_property': 6451}
 
 
@@ -1472,7 +1474,7 @@ class SemanticsClosestIsRemote(MessagingHandler):
         Container(self).run()
 
 
-class CustomTimeout(object):
+class CustomTimeout:
     def __init__(self, parent):
         self.parent = parent
 
diff --git a/tests/test_broker.py b/tests/test_broker.py
index 61a15b7..24c7ae2 100644
--- a/tests/test_broker.py
+++ b/tests/test_broker.py
@@ -36,7 +36,7 @@ class FakeBroker(MessagingHandler):
     """
     A fake broker-like service that listens for client connections
     """
-    class _Queue(object):
+    class _Queue:
         def __init__(self, name, logger, dynamic=False):
             self.dynamic = dynamic
             self.queue = collections.deque()
diff --git a/tests/tox.ini.in b/tests/tox.ini.in
index a13e1b3..6c0d1fb 100644
--- a/tests/tox.ini.in
+++ b/tests/tox.ini.in
@@ -25,15 +25,30 @@ skip_missing_interpreters = True
 skip_install = True
 
 [testenv]
-commands = flake8 --count --show-source \
-  ${CMAKE_SOURCE_DIR}/python \
-  ${CMAKE_SOURCE_DIR}/console \
-  ${CMAKE_SOURCE_DIR}/docs \
-  ${CMAKE_SOURCE_DIR}/tests \
-  ${CMAKE_SOURCE_DIR}/tools \
-  ${CMAKE_SOURCE_DIR}/tools/qdstat \
-  ${CMAKE_SOURCE_DIR}/tools/qdmanage
-deps = hacking>=1.1.0
+commands =
+  flake8 --count --show-source \
+    ${CMAKE_SOURCE_DIR}/python \
+    ${CMAKE_SOURCE_DIR}/console \
+    ${CMAKE_SOURCE_DIR}/docs \
+    ${CMAKE_SOURCE_DIR}/tests \
+    ${CMAKE_SOURCE_DIR}/tools \
+    ${CMAKE_SOURCE_DIR}/tools/qdstat \
+    ${CMAKE_SOURCE_DIR}/tools/qdmanage
+
+  # TODO(pylint#5648): crash while parsing system_test.py
+  pylint --rcfile ${CMAKE_BINARY_DIR}/tests/tox.ini \
+    --ignore=system_test.py \
+    ${CMAKE_SOURCE_DIR}/python \
+    ${CMAKE_SOURCE_DIR}/console \
+    ${CMAKE_SOURCE_DIR}/docs \
+    ${CMAKE_SOURCE_DIR}/tests \
+    ${CMAKE_SOURCE_DIR}/tools \
+    ${CMAKE_SOURCE_DIR}/tools/qdstat \
+    ${CMAKE_SOURCE_DIR}/tools/qdmanage
+
+deps =
+    hacking>=1.1.0
+    pylint
 
 [testenv:py36]
 basepython = python3.6
@@ -122,3 +137,71 @@ exclude =
 # https://github.com/pytest-dev/pytest/blob/main/src/_pytest/junitxml.py
 # do not filter test file names
 python_files = *.py
+
+# pylint
+[MESSAGE_CONTROL]
+disable =
+    access-member-before-definition,
+    arguments-differ,
+    attribute-defined-outside-init,
+    bad-super-call,
+    bare-except,
+    broad-except,
+    consider-iterating-dictionary,
+    consider-using-dict-comprehension,
+    consider-using-dict-items,
+    consider-using-enumerate,
+    consider-using-f-string,
+    consider-using-with,
+    deprecated-module,
+    duplicate-code,
+    empty-docstring,
+    fatal,
+    fixme,
+    function-redefined,
+    global-statement,
+    import-error,
+    import-outside-toplevel,
+    inconsistent-return-statements,
+    invalid-name,
+    line-too-long,
+    method-hidden,
+    missing-docstring,
+    missing-function-docstring,
+    missing-module-docstring,
+    multiple-statements,
+    no-else-break,
+    no-else-raise,
+    no-else-return,
+    no-member,
+    no-name-in-module,
+    no-self-use,
+    parse-error,
+    protected-access,
+    raise-missing-from,
+    redefined-builtin,
+    redefined-outer-name,
+    redundant-unittest-assert,
+    singleton-comparison,
+    super-init-not-called,
+    super-with-arguments,
+    too-few-public-methods,
+    too-many-arguments,
+    too-many-branches,
+    too-many-instance-attributes,
+    too-many-lines,
+    too-many-locals,
+    too-many-nested-blocks,
+    too-many-public-methods,
+    too-many-return-statements,
+    too-many-statements,
+    unnecessary-pass,
+    unspecified-encoding,
+    unsubscriptable-object,
+    unused-argument,
+    unused-variable,
+    use-dict-literal,
+    use-list-literal,
+    useless-else-on-loop,
+    useless-super-delegation,
+    wrong-import-position,
diff --git a/tools/qdstat b/tools/qdstat
index 29941e0..9e34ccf 100755
--- a/tools/qdstat
+++ b/tools/qdstat
@@ -40,7 +40,7 @@ def get(obj, attr):
     return getattr(obj, attr, None)
 
 
-class BusManager(object):
+class BusManager:
 
     schema = QdSchema()
 
diff --git a/tools/scraper/parser.py b/tools/scraper/parser.py
index 2bff233..4e1f4cd 100755
--- a/tools/scraper/parser.py
+++ b/tools/scraper/parser.py
@@ -371,7 +371,7 @@ class DescribedType:
                 self.dict[key] = val
 
 
-class ParsedLogLine(object):
+class ParsedLogLine:
     """
     Grind through the log line and record some facts about it.
     * Constructor returns Null if the log line is to be ignored

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

Reply via email to