https://github.com/giampaolo/psutil/issues/2331 --- psutil-6.0.0/psutil/tests/test_connections.py.orig +++ psutil-6.0.0/psutil/tests/test_connections.py @@ -429,13 +429,13 @@ with create_sockets(): # tcp cons = this_proc_net_connections(kind='tcp') - self.assertEqual(len(cons), 2 if supports_ipv6() else 1) + self.assertEqual(len(cons), 3 if supports_ipv6() else 2) for conn in cons: self.assertIn(conn.family, (AF_INET, AF_INET6)) self.assertEqual(conn.type, SOCK_STREAM) # tcp4 cons = this_proc_net_connections(kind='tcp4') - self.assertEqual(len(cons), 1) + self.assertEqual(len(cons), 2) self.assertEqual(cons[0].family, AF_INET) self.assertEqual(cons[0].type, SOCK_STREAM) # tcp6 @@ -446,13 +446,13 @@ self.assertEqual(cons[0].type, SOCK_STREAM) # udp cons = this_proc_net_connections(kind='udp') - self.assertEqual(len(cons), 2 if supports_ipv6() else 1) + self.assertEqual(len(cons), 3 if supports_ipv6() else 2) for conn in cons: self.assertIn(conn.family, (AF_INET, AF_INET6)) self.assertEqual(conn.type, SOCK_DGRAM) # udp4 cons = this_proc_net_connections(kind='udp4') - self.assertEqual(len(cons), 1) + self.assertEqual(len(cons), 2) self.assertEqual(cons[0].family, AF_INET) self.assertEqual(cons[0].type, SOCK_DGRAM) # udp6 @@ -463,7 +463,7 @@ self.assertEqual(cons[0].type, SOCK_DGRAM) # inet cons = this_proc_net_connections(kind='inet') - self.assertEqual(len(cons), 4 if supports_ipv6() else 2) + self.assertEqual(len(cons), 6 if supports_ipv6() else 4) for conn in cons: self.assertIn(conn.family, (AF_INET, AF_INET6)) self.assertIn(conn.type, (SOCK_STREAM, SOCK_DGRAM))