mirror of https://github.com/python/cpython
Skip test in test_socket.py if `sys.getrefcount` isn't available (#126640)
Skip `testMakefileCloseSocketDestroy` test if `sys.getrefcount` isn't available. This is necessary for PyPy and other Python implementations that do not have `sys.getrefcount`.
This commit is contained in:
parent
160758a574
commit
0f6bb28ff3
|
@ -5334,6 +5334,8 @@ class UnbufferedFileObjectClassTestCase(FileObjectClassTestCase):
|
|||
self.write_file.write(self.write_msg)
|
||||
self.write_file.flush()
|
||||
|
||||
@unittest.skipUnless(hasattr(sys, 'getrefcount'),
|
||||
'test needs sys.getrefcount()')
|
||||
def testMakefileCloseSocketDestroy(self):
|
||||
refcount_before = sys.getrefcount(self.cli_conn)
|
||||
self.read_file.close()
|
||||
|
|
Loading…
Reference in New Issue