MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_weakref

Method test_weakref

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

Source from the content-addressed store, hash-verified

953 self.assertEqual(repr(s), expected)
954
955 def test_weakref(self):
956 with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
957 p = proxy(s)
958 self.assertEqual(p.fileno(), s.fileno())
959 s = None
960 support.gc_collect() # For PyPy or other GCs.
961 try:
962 p.fileno()
963 except ReferenceError:
964 pass
965 else:
966 self.fail('Socket proxy still exists')
967
968 def testSocketError(self):
969 # Testing socket module exceptions

Callers

nothing calls this directly

Calls 5

proxyFunction · 0.90
socketMethod · 0.80
assertEqualMethod · 0.45
filenoMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected