File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -244,8 +244,6 @@ def receive(self, channel):
244244 channel , self .COMMAND_MESSAGE_STATUS , protocol .MessageStatusResponse
245245 )
246246
247- print (status .unknown )
248-
249247 if status .rx_pending == 0 :
250248 return []
251249
Original file line number Diff line number Diff line change 11import canalystii
2+ import gc
23import pytest
34import struct
45
56
6- @pytest .fixture (scope = "session" ) # TODO: figure out how to properly GC these
7+ @pytest .fixture () # scope="session") # TODO: figure out how to properly GC these
78def device ():
9+ gc .collect ()
810 dev = canalystii .CanalystDevice (bitrate = 1000000 )
911 dev .clear_rx_buffer (0 )
1012 dev .clear_rx_buffer (1 )
@@ -115,7 +117,8 @@ def test_stop_receiver(device):
115117 device .stop (1 )
116118
117119 assert device .send (0 , msg0 , 0.1 )
118- assert not device .receive (1 )
120+ with pytest .raises (RuntimeError ):
121+ device .receive (1 )
119122
120123 device .start (1 )
121124
@@ -131,7 +134,8 @@ def test_stop_sender(device):
131134
132135 device .stop (0 )
133136
134- assert device .send (0 , msg0 , 0.1 )
137+ with pytest .raises (RuntimeError ):
138+ device .send (0 , msg0 , 0.1 )
135139 assert not device .receive (1 )
136140
137141 device .start (0 )
You can’t perform that action at this time.
0 commit comments