Remove pylint:disable

This commit is contained in:
mhchia
2019-08-02 23:19:36 +08:00
parent 06a9511ab4
commit 2e94fcf56c
36 changed files with 7 additions and 64 deletions

View File

@ -5,7 +5,6 @@ from tests.utils import cleanup, set_up_nodes_by_transport_opt
from libp2p.peer.peerinfo import info_from_p2p_addr
# pylint: disable=too-many-locals
@pytest.mark.asyncio
async def test_simple_messages():
transport_opt_list = [["/ip4/127.0.0.1/tcp/0"], ["/ip4/127.0.0.1/tcp/0"]]

View File

@ -22,11 +22,9 @@ from libp2p import new_node, initialize_default_swarm
from libp2p.network.notifee_interface import INotifee
from libp2p.host.basic_host import BasicHost
# pylint: disable=too-many-locals
class MyNotifee(INotifee):
# pylint: disable=too-many-instance-attributes, cell-var-from-loop
def __init__(self, events, val_to_append_to_event):
self.events = events
@ -52,7 +50,6 @@ class MyNotifee(INotifee):
class InvalidNotifee:
# pylint: disable=too-many-instance-attributes, cell-var-from-loop
def __init__(self):
pass

View File

@ -14,13 +14,11 @@ def test_init():
for _ in range(10):
random_id_string += random.SystemRandom().choice(ALPHABETS)
peer_id = ID(random_id_string.encode())
# pylint: disable=protected-access
assert peer_id == random_id_string.encode()
def test_no_init_value():
with pytest.raises(Exception) as _:
# pylint: disable=no-value-for-parameter
ID()

View File

@ -28,7 +28,6 @@ def test_init_():
def test_init_no_value():
with pytest.raises(Exception) as _:
# pylint: disable=no-value-for-parameter
PeerInfo()
@ -50,7 +49,6 @@ def test_info_from_p2p_addr_invalid(addr):
def test_info_from_p2p_addr_valid():
# pylint: disable=line-too-long
m_addr = multiaddr.Multiaddr(
"/ip4/127.0.0.1/tcp/8000/p2p/3YgLAeMKSAPcGqZkAt8mREqhQXmJT8SN8VCMN4T6ih4GNX9wvK8mWJnWZ1qA2mLdCQ"
)

View File

@ -8,7 +8,6 @@ from .configs import GOSSIPSUB_PARAMS
from .factories import FloodsubFactory, GossipsubFactory, HostFactory, PubsubFactory
# pylint: disable=redefined-outer-name
@pytest.fixture

View File

@ -137,14 +137,12 @@ FLOODSUB_PROTOCOL_TEST_CASES = [
},
]
# pylint: disable=invalid-name
floodsub_protocol_pytest_params = [
pytest.param(test_case, id=test_case["name"])
for test_case in FLOODSUB_PROTOCOL_TEST_CASES
]
# pylint: disable=too-many-locals
async def perform_test_from_obj(obj, router_factory):
"""
Perform pubsub tests from a test obj.

View File

@ -7,7 +7,6 @@ from tests.utils import cleanup, connect
from .dummy_account_node import DummyAccountNode
# pylint: disable=too-many-locals
def create_setup_in_new_thread_func(dummy_node):

View File

@ -13,7 +13,6 @@ from .floodsub_integration_test_settings import (
)
# pylint: disable=too-many-locals
@pytest.mark.parametrize("num_hosts", (2,))

View File

@ -10,7 +10,6 @@ from .floodsub_integration_test_settings import (
)
# pylint: disable=too-many-locals
@pytest.mark.asyncio
async def test_gossipsub_initialize_with_floodsub_protocol():
GossipsubFactory(protocols=[FLOODSUB_PROTOCOL_ID])

View File

@ -3,10 +3,8 @@ import pytest
from libp2p.pubsub.mcache import MessageCache
# pylint: disable=too-few-public-methods
class Msg:
def __init__(self, topicIDs, seqno, from_id):
# pylint: disable=invalid-name
self.topicIDs = topicIDs
self.seqno = seqno
self.from_id = from_id

View File

@ -75,7 +75,6 @@ async def test_get_hello_packet(pubsubs_fsub):
packet.ParseFromString(pubsubs_fsub[0].get_hello_packet())
return tuple(sub.topicid for sub in packet.subscriptions)
# pylint: disable=len-as-condition
# Test: No subscription, so there should not be any topic ids in the hello packet.
assert len(_get_hello_packet_topic_ids()) == 0
@ -295,7 +294,6 @@ async def test_publish(pubsubs_fsub, monkeypatch):
@pytest.mark.parametrize("num_hosts", (1,))
@pytest.mark.asyncio
async def test_push_msg(pubsubs_fsub, monkeypatch):
# pylint: disable=protected-access
msg_0 = make_pubsub_msg(
origin_id=pubsubs_fsub[0].my_id,
topic_ids=[TESTING_TOPIC],

View File

@ -1,6 +1,5 @@
import pytest
# pylint: disable=eval-used
@pytest.mark.parametrize("test_input,expected", [("3+5", 8), ("2+4", 6), ("6*9", 54)])