Skip to content

Commit

Permalink
fix PCAN test DeprecationWarnings (#1801)
Browse files Browse the repository at this point in the history
  • Loading branch information
zariiii9003 authored Jun 21, 2024
1 parent 25c6fe0 commit 7366c42
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/test_pcan.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ def test_bus_creation(self) -> None:

self.assertIsInstance(self.bus, PcanBus)
self.assertEqual(self.bus.protocol, CanProtocol.CAN_20)
self.assertFalse(self.bus.fd)

with pytest.deprecated_call():
self.assertFalse(self.bus.fd)

self.MockPCANBasic.assert_called_once()
self.mock_pcan.Initialize.assert_called_once()
Expand Down Expand Up @@ -83,7 +85,9 @@ def test_bus_creation_fd(self, clock_param: str, clock_val: int) -> None:

self.assertIsInstance(self.bus, PcanBus)
self.assertEqual(self.bus.protocol, CanProtocol.CAN_FD)
self.assertTrue(self.bus.fd)

with pytest.deprecated_call():
self.assertTrue(self.bus.fd)

self.MockPCANBasic.assert_called_once()
self.mock_pcan.Initialize.assert_not_called()
Expand Down

0 comments on commit 7366c42

Please sign in to comment.