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

Method test_weakref

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

Source from the content-addressed store, hash-verified

963 self.assertEqual(repr(s), expected)
964
965 def test_weakref(self):
966 with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
967 p = proxy(s)
968 self.assertEqual(p.fileno(), s.fileno())
969 s = None
970 support.gc_collect() # For PyPy or other GCs.
971 try:
972 p.fileno()
973 except ReferenceError:
974 pass
975 else:
976 self.fail('Socket proxy still exists')
977
978 def testSocketError(self):
979 # Testing socket module exceptions

Callers

nothing calls this directly

Calls 4

socketMethod · 0.80
assertEqualMethod · 0.45
filenoMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected