fix linting issues

This commit is contained in:
zixuanzh 2019-03-17 21:30:56 -04:00
parent 0d15126ffc
commit d67aeb1974
5 changed files with 12 additions and 11 deletions

View File

@ -35,7 +35,7 @@ def initialize_default_swarm(
:param peerstore_opt: optional peerstore :param peerstore_opt: optional peerstore
:return: return a default swarm instance :return: return a default swarm instance
""" """
# pylint: disable=too-many-arguments # pylint: disable=too-many-arguments, unused-argument
if not id_opt: if not id_opt:
new_key = RSA.generate(2048, e=65537) new_key = RSA.generate(2048, e=65537)
id_opt = id_from_public_key(new_key.publickey()) id_opt = id_from_public_key(new_key.publickey())

View File

@ -2,7 +2,6 @@ import multiaddr
import pytest import pytest
from tests.utils import cleanup, set_up_nodes_by_transport_opt from tests.utils import cleanup, set_up_nodes_by_transport_opt
from libp2p import new_node
from libp2p.peer.peerinfo import info_from_p2p_addr from libp2p.peer.peerinfo import info_from_p2p_addr

View File

@ -10,8 +10,11 @@ features are implemented in swarm
""" """
import pytest import pytest
import multiaddr
from tests.utils import *
from tests.utils import cleanup, echo_stream_handler, \
perform_two_host_set_up_custom_handler
from libp2p import new_node, initialize_default_swarm from libp2p import new_node, initialize_default_swarm
from libp2p.network.notifee_interface import INotifee from libp2p.network.notifee_interface import INotifee
from libp2p.host.basic_host import BasicHost from libp2p.host.basic_host import BasicHost
@ -39,11 +42,11 @@ class MyNotifee(INotifee):
async def disconnected(self, network, conn): async def disconnected(self, network, conn):
pass pass
async def listen(self, network, multiaddr): async def listen(self, network, _multiaddr):
self.events.append(["listened" + self.val_to_append_to_event,\ self.events.append(["listened" + self.val_to_append_to_event,\
multiaddr]) _multiaddr])
async def listen_close(self, network, multiaddr): async def listen_close(self, network, _multiaddr):
pass pass
class InvalidNotifee(): class InvalidNotifee():

View File

@ -1,7 +1,6 @@
import pytest import pytest
from tests.utils import cleanup, set_up_nodes_by_transport_opt from tests.utils import cleanup, set_up_nodes_by_transport_opt
from libp2p import new_node
from libp2p.protocol_muxer.multiselect_client import MultiselectClientError from libp2p.protocol_muxer.multiselect_client import MultiselectClientError
# TODO: Add tests for multiple streams being opened on different # TODO: Add tests for multiple streams being opened on different