We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9f7cb8c commit 3f8c3b7Copy full SHA for 3f8c3b7
test/network_test.py
@@ -14,10 +14,8 @@
14
import can
15
16
channel = "vcan0"
17
-can.rc["interface"] = "virtual"
18
19
20
-@unittest.skipIf("interface" not in can.rc, "Need a CAN interface")
21
class ControllerAreaNetworkTestCase(unittest.TestCase):
22
"""
23
This test ensures that what messages go in to the bus is what comes out.
@@ -42,6 +40,15 @@ class ControllerAreaNetworkTestCase(unittest.TestCase):
42
40
for b in range(num_messages)
43
41
)
44
+ def setUp(self):
+ # Save all can.rc defaults
45
+ self._can_rc = can.rc
46
+ can.rc = {"interface": "virtual"}
47
+
48
+ def tearDown(self):
49
+ # Restore the defaults
50
+ can.rc = self._can_rc
51
52
def producer(self, ready_event, msg_read):
53
self.client_bus = can.interface.Bus(channel=channel)
54
ready_event.wait()
0 commit comments