Skip to content

Commit 19deb65

Browse files
committed
Fix syntax errors
1 parent 79ebba3 commit 19deb65

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

test/test_subscription.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
- test_single_subscription_with_disconnect() : Test single subscription connections between ChaskiNodes with node disconnection during pairing.
1818
"""
1919

20+
import pytest
2021
import unittest
2122
import asyncio
2223
from typing import Optional
2324
from chaski.utils.auto import create_nodes
24-
from chaski.scripts import terminate_connections
2525
from 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

Comments
 (0)