Remove cleanup

`cleanup` cancels all tasks in the loop, including the main one run by
`run_until_complete`
This commit is contained in:
mhchia
2019-09-09 23:09:33 +08:00
parent a45eb76421
commit bb0da41eda
10 changed files with 9 additions and 65 deletions

View File

@ -3,7 +3,7 @@ import pytest
from libp2p.peer.peerinfo import info_from_p2p_addr
from tests.constants import MAX_READ_LEN
from tests.utils import cleanup, set_up_nodes_by_transport_opt
from tests.utils import set_up_nodes_by_transport_opt
@pytest.mark.asyncio
@ -34,7 +34,6 @@ async def test_simple_messages():
assert response == ("ack:" + message)
# Success, terminate pending tasks.
await cleanup()
@pytest.mark.asyncio
@ -69,7 +68,6 @@ async def test_double_response():
assert response2 == ("ack2:" + message)
# Success, terminate pending tasks.
await cleanup()
@pytest.mark.asyncio
@ -120,7 +118,6 @@ async def test_multiple_streams():
)
# Success, terminate pending tasks.
await cleanup()
@pytest.mark.asyncio
@ -183,7 +180,6 @@ async def test_multiple_streams_same_initiator_different_protocols():
)
# Success, terminate pending tasks.
await cleanup()
@pytest.mark.asyncio
@ -264,7 +260,6 @@ async def test_multiple_streams_two_initiators():
)
# Success, terminate pending tasks.
await cleanup()
@pytest.mark.asyncio
@ -326,7 +321,6 @@ async def test_triangle_nodes_connection():
assert response == ("ack:" + message)
# Success, terminate pending tasks.
await cleanup()
@pytest.mark.asyncio
@ -353,4 +347,3 @@ async def test_host_connect():
assert addr.encapsulate(ma_node_b) in node_b.get_addrs()
# Success, terminate pending tasks.
await cleanup()

View File

@ -17,7 +17,7 @@ from libp2p.crypto.rsa import create_new_key_pair
from libp2p.host.basic_host import BasicHost
from libp2p.network.notifee_interface import INotifee
from tests.constants import MAX_READ_LEN
from tests.utils import cleanup, perform_two_host_set_up
from tests.utils import perform_two_host_set_up
ACK = "ack:"
@ -91,7 +91,6 @@ async def test_one_notifier():
assert response == expected_resp
# Success, terminate pending tasks.
await cleanup()
@pytest.mark.asyncio
@ -138,7 +137,6 @@ async def test_one_notifier_on_two_nodes():
assert response == expected_resp
# Success, terminate pending tasks.
await cleanup()
@pytest.mark.asyncio
@ -203,7 +201,6 @@ async def test_one_notifier_on_two_nodes_with_listen():
assert response == expected_resp
# Success, terminate pending tasks.
await cleanup()
@pytest.mark.asyncio
@ -235,7 +232,6 @@ async def test_two_notifiers():
assert response == expected_resp
# Success, terminate pending tasks.
await cleanup()
@pytest.mark.asyncio
@ -271,7 +267,6 @@ async def test_ten_notifiers():
assert response == expected_resp
# Success, terminate pending tasks.
await cleanup()
@pytest.mark.asyncio
@ -325,7 +320,6 @@ async def test_ten_notifiers_on_two_nodes():
assert response == expected_resp
# Success, terminate pending tasks.
await cleanup()
@pytest.mark.asyncio
@ -355,4 +349,3 @@ async def test_invalid_notifee():
assert response == expected_resp
# Success, terminate pending tasks.
await cleanup()