55"""
66
77import gc
8+ import platform
89import sys
910import time
1011import traceback
1112import unittest
1213from threading import Thread
1314from time import sleep
14- from typing import List
1515from unittest .mock import MagicMock
1616
1717import can
1818
19- from .config import *
19+ from .config import IS_CI , IS_PYPY
2020from .message_helper import ComparingMessagesTestCase
2121
2222
@@ -133,7 +133,7 @@ def test_stopping_perodic_tasks(self):
133133 data = [0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ],
134134 )
135135 msg .arbitration_id = task_i
136- task = bus .send_periodic (msg , 0.1 , 1 )
136+ task = bus .send_periodic (msg , period = 0. 1 )
137137 tasks .append (task )
138138
139139 assert len (bus ._periodic_tasks ) == 10
@@ -261,7 +261,7 @@ def test_thread_based_cyclic_send_task(self):
261261 task .stop ()
262262
263263 def test_modifier_callback (self ) -> None :
264- msg_list : List [can .Message ] = []
264+ msg_list : list [can .Message ] = []
265265
266266 def increment_first_byte (msg : can .Message ) -> None :
267267 msg .data [0 ] = (msg .data [0 ] + 1 ) % 256
@@ -288,8 +288,8 @@ def increment_first_byte(msg: can.Message) -> None:
288288 self .assertEqual (b"\x07 \x00 \x00 \x00 \x00 \x00 \x00 \x00 " , bytes (msg_list [6 ].data ))
289289
290290 @staticmethod
291- def join_threads (threads : List [Thread ], timeout : float ) -> None :
292- stuck_threads : List [Thread ] = []
291+ def join_threads (threads : list [Thread ], timeout : float ) -> None :
292+ stuck_threads : list [Thread ] = []
293293 t0 = time .perf_counter ()
294294 for thread in threads :
295295 time_left = timeout - (time .perf_counter () - t0 )
0 commit comments