Fixed pylint & flake8 warnings and errors.

This commit is contained in:
Joe Testa 2022-10-10 20:40:29 -04:00
parent 0b8ecf2fb5
commit b9520cbc25
3 changed files with 5 additions and 7 deletions

View File

@ -325,7 +325,7 @@ class SSH_Socket(ReadBuf, WriteBuf):
self.__header = []
self.__banner = None
def _close_socket(self, s: Optional[socket.socket]) -> None: # pylint: disable=no-self-use
def _close_socket(self, s: Optional[socket.socket]) -> None:
try:
if s is not None:
s.shutdown(socket.SHUT_RDWR)

View File

@ -41,15 +41,15 @@ class TestPolicy:
for policy_name in Policy.BUILTIN_POLICIES:
# Ensure that the policy name ends with " (version X)", where X is the 'version' field.
version_str = " (version %s)" % Policy.BUILTIN_POLICIES[policy_name]['version']
assert(policy_name.endswith(version_str))
assert policy_name.endswith(version_str)
# Ensure that each built-in policy can be loaded with Policy.load_builtin_policy().
assert(Policy.load_builtin_policy(policy_name) is not None)
assert Policy.load_builtin_policy(policy_name) is not None
# Ensure that both server and client policy names are returned.
server_policy_names, client_policy_names = Policy.list_builtin_policies()
assert(len(server_policy_names) > 0)
assert(len(client_policy_names) > 0)
assert len(server_policy_names) > 0
assert len(client_policy_names) > 0
def test_policy_basic(self):

View File

@ -91,14 +91,12 @@ reports = no
#output-format = colorized
indent-string = " "
disable =
bad-continuation,
broad-except,
duplicate-code,
fixme,
invalid-name,
line-too-long,
missing-docstring,
mixed-indentation,
no-else-raise,
no-else-return,
super-with-arguments, # Can be re-factored, at some point.