Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/back2back_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Back2BackTestCase(unittest.TestCase):
"""

BITRATE = 500000
TIMEOUT = 0.1
TIMEOUT = 1.0 if IS_PYPY else 0.1

INTERFACE_1 = "virtual"
CHANNEL_1 = "virtual_channel_0"
Expand Down
12 changes: 6 additions & 6 deletions test/simplecyclic_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
"""

import gc
import platform
import sys
import time
import traceback
import unittest
from threading import Thread
from time import sleep
from typing import List
from unittest.mock import MagicMock

import can

from .config import *
from .config import IS_CI, IS_PYPY
from .message_helper import ComparingMessagesTestCase


Expand Down Expand Up @@ -133,7 +133,7 @@ def test_stopping_perodic_tasks(self):
data=[0, 1, 2, 3, 4, 5, 6, 7],
)
msg.arbitration_id = task_i
task = bus.send_periodic(msg, 0.1, 1)
task = bus.send_periodic(msg, period=0.1)
tasks.append(task)

assert len(bus._periodic_tasks) == 10
Expand Down Expand Up @@ -261,7 +261,7 @@ def test_thread_based_cyclic_send_task(self):
task.stop()

def test_modifier_callback(self) -> None:
msg_list: List[can.Message] = []
msg_list: list[can.Message] = []

def increment_first_byte(msg: can.Message) -> None:
msg.data[0] = (msg.data[0] + 1) % 256
Expand All @@ -288,8 +288,8 @@ def increment_first_byte(msg: can.Message) -> None:
self.assertEqual(b"\x07\x00\x00\x00\x00\x00\x00\x00", bytes(msg_list[6].data))

@staticmethod
def join_threads(threads: List[Thread], timeout: float) -> None:
stuck_threads: List[Thread] = []
def join_threads(threads: list[Thread], timeout: float) -> None:
stuck_threads: list[Thread] = []
t0 = time.perf_counter()
for thread in threads:
time_left = timeout - (time.perf_counter() - t0)
Expand Down
Loading