summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
authorkarl ding <karlding@users.noreply.github.com>2021-05-04 20:37:13 (GMT)
committerGitHub <noreply@github.com>2021-05-04 20:37:13 (GMT)
commit355bae88822bee4de6092b63d69c5a5dad393a16 (patch)
tree6ff02a4b4eca8ecb1e3fd9362d7995e421ff788a /Lib/test/test_socket.py
parent09490298d4485e9322edc6e1e8e15eb66c586164 (diff)
downloadcpython-355bae88822bee4de6092b63d69c5a5dad393a16.zip
cpython-355bae88822bee4de6092b63d69c5a5dad393a16.tar.gz
cpython-355bae88822bee4de6092b63d69c5a5dad393a16.tar.bz2
bpo-40297: Fix test_socket.CANTest.testSendFrame (GH-19548)
The address tuple for CAN_RAW no longer returns the address family after the introduction of CAN ISO-TP support in a30f6d45ac3. However, updating test_socket.CANTest.testSendFrame was missed as part of the change, so the test incorrectly attempts to index past the last tuple item to retrieve the address family. This removes the now-redundant check for equality against socket.AF_CAN, as the tuple will not contain the address family.
Diffstat (limited to 'Lib/test/test_socket.py')
-rwxr-xr-xLib/test/test_socket.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 3c45278..828d1f3 100755
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -224,7 +224,7 @@ class SocketCANTest(unittest.TestCase):
the following commands:
# modprobe vcan
# ip link add dev vcan0 type vcan
- # ifconfig vcan0 up
+ # ip link set up vcan0
"""
interface = 'vcan0'
bufsize = 128
@@ -2085,7 +2085,6 @@ class CANTest(ThreadedCANSocketTest):
cf, addr = self.s.recvfrom(self.bufsize)
self.assertEqual(self.cf, cf)
self.assertEqual(addr[0], self.interface)
- self.assertEqual(addr[1], socket.AF_CAN)
def _testSendFrame(self):
self.cf = self.build_can_frame(0x00, b'\x01\x02\x03\x04\x05')