99
1010"""
1111
12+ import pytest
1213import unittest
1314import asyncio
1415import os
@@ -26,10 +27,14 @@ class TestStreamer(unittest.IsolatedAsyncioTestCase):
2627 to ensure that messages are correctly streamed and received.
2728 """
2829
29- #
30- def tearDown (self ):
31- terminate_connections .main ()
30+ nodes = []
3231
32+ async def asyncTearDown (self ):
33+ for node in self .nodes :
34+ print (f"Closing node { node .port } " )
35+ await node .stop ()
36+
37+ @pytest .mark .asyncio
3338 async def test_stream (self ) -> None :
3439 """
3540 Test the streaming functionality between a producer and a consumer.
@@ -62,6 +67,7 @@ async def test_stream(self) -> None:
6267
6368 await run_transmission (producer , consumer , parent = self )
6469
70+ @pytest .mark .asyncio
6571 async def test_file_transfer (self ) -> None :
6672 """
6773 Test the file transfer functionality between a producer and a consumer.
@@ -153,6 +159,7 @@ def new_file_event(**kwargs):
153159 await consumer .stop ()
154160 await producer .stop ()
155161
162+ @pytest .mark .asyncio
156163 async def test_file_dissable_transfer (self ) -> None :
157164 """
158165 Test the file transfer functionality when the consumer has file transfer disabled.
@@ -213,6 +220,7 @@ async def test_file_dissable_transfer(self) -> None:
213220 await consumer .stop ()
214221 await producer .stop ()
215222
223+ @pytest .mark .asyncio
216224 async def test_stream_chain (self ) -> None :
217225 """
218226 Test chaining of multiple ChaskiStreamer instances end-to-end.
@@ -312,6 +320,7 @@ async def test_stream_chain(self) -> None:
312320 await chain4 .stop ()
313321 await chain5 .stop ()
314322
323+ @pytest .mark .asyncio
315324 async def test_root_node (self ) -> None :
316325 """
317326 Test chaining of multiple ChaskiStreamer instances end-to-end.
0 commit comments