MCPcopy Index your code
hub / github.com/python/cpython / test_csocket_repr

Method test_csocket_repr

Lib/test/test_socket.py:953–963  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

951
952 @unittest.skipUnless(_socket is not None, 'need _socket module')
953 def test_csocket_repr(self):
954 s = _socket.socket(_socket.AF_INET, _socket.SOCK_STREAM)
955 try:
956 expected = ('<socket object, fd=%s, family=%s, type=%s, proto=%s>'
957 % (s.fileno(), s.family, s.type, s.proto))
958 self.assertEqual(repr(s), expected)
959 finally:
960 s.close()
961 expected = ('<socket object, fd=-1, family=%s, type=%s, proto=%s>'
962 % (s.family, s.type, s.proto))
963 self.assertEqual(repr(s), expected)
964
965 def test_weakref(self):
966 with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:

Callers

nothing calls this directly

Calls 4

socketMethod · 0.80
filenoMethod · 0.45
assertEqualMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected