1717- test_single_subscription_with_disconnect() : Test single subscription connections between ChaskiNodes with node disconnection during pairing.
1818"""
1919
20+ import pytest
2021import unittest
2122import asyncio
2223from typing import Optional
2324from chaski .utils .auto import create_nodes
24- from chaski .scripts import terminate_connections
2525from chaski .node import ChaskiNode
2626
2727
@@ -33,13 +33,12 @@ class TestSubscriptions(unittest.IsolatedAsyncioTestCase):
3333 and validate the correct establishment of connections based on their subscription topics.
3434 """
3535
36- def setUp (self ):
37- self .nodes = []
38- self .host = "127.0.0.1"
36+ nodes = []
37+ host = "127.0.0.1"
3938
40- async def tearDown (self ):
41- terminate_connections .main ([node .port for node in self .nodes ])
39+ async def asyncTearDown (self ):
4240 for node in self .nodes :
41+ print (f"Closing node { node .port } " )
4342 await node .stop ()
4443
4544 def assertConnection (
@@ -98,6 +97,7 @@ def assertNoConnection(
9897 conn = node1 .is_connected_to (node2 ) and node2 .is_connected_to (node1 )
9998 return self .assertFalse (conn , msg )
10099
100+ @pytest .mark .asyncio
101101 async def test_single_subscription_no_disconnect (self ):
102102 """
103103 Test single subscription connections between ChaskiNodes without disconnecting other nodes.
@@ -142,6 +142,7 @@ async def test_single_subscription_no_disconnect(self):
142142 "Node 2 should be connected to Node 5 because both nodes are subscribed to the topic 'C'." ,
143143 )
144144
145+ @pytest .mark .asyncio
145146 async def test_single_subscription_with_disconnect (self ):
146147 """"""
147148 self .nodes = await create_nodes (
0 commit comments