5
5
"""
6
6
7
7
import gc
8
+ import platform
8
9
import sys
9
10
import time
10
11
import traceback
11
12
import unittest
12
13
from threading import Thread
13
14
from time import sleep
14
- from typing import List
15
15
from unittest .mock import MagicMock
16
16
17
17
import can
18
18
19
- from .config import *
19
+ from .config import IS_CI , IS_PYPY
20
20
from .message_helper import ComparingMessagesTestCase
21
21
22
22
@@ -133,7 +133,7 @@ def test_stopping_perodic_tasks(self):
133
133
data = [0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ],
134
134
)
135
135
msg .arbitration_id = task_i
136
- task = bus .send_periodic (msg , 0.1 , 1 )
136
+ task = bus .send_periodic (msg , period = 0. 1 )
137
137
tasks .append (task )
138
138
139
139
assert len (bus ._periodic_tasks ) == 10
@@ -261,7 +261,7 @@ def test_thread_based_cyclic_send_task(self):
261
261
task .stop ()
262
262
263
263
def test_modifier_callback (self ) -> None :
264
- msg_list : List [can .Message ] = []
264
+ msg_list : list [can .Message ] = []
265
265
266
266
def increment_first_byte (msg : can .Message ) -> None :
267
267
msg .data [0 ] = (msg .data [0 ] + 1 ) % 256
@@ -288,8 +288,8 @@ def increment_first_byte(msg: can.Message) -> None:
288
288
self .assertEqual (b"\x07 \x00 \x00 \x00 \x00 \x00 \x00 \x00 " , bytes (msg_list [6 ].data ))
289
289
290
290
@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 ] = []
293
293
t0 = time .perf_counter ()
294
294
for thread in threads :
295
295
time_left = timeout - (time .perf_counter () - t0 )
0 commit comments