Skip to content

Commit 0f6bb28

Browse files
authored
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`.
1 parent 160758a commit 0f6bb28

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Lib/test/test_socket.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5334,6 +5334,8 @@ def _testMakefileClose(self):
53345334
self.write_file.write(self.write_msg)
53355335
self.write_file.flush()
53365336

5337+
@unittest.skipUnless(hasattr(sys, 'getrefcount'),
5338+
'test needs sys.getrefcount()')
53375339
def testMakefileCloseSocketDestroy(self):
53385340
refcount_before = sys.getrefcount(self.cli_conn)
53395341
self.read_file.close()

0 commit comments

Comments
 (0)