Skip to content

Commit a6b83a8

Browse files
cfbolzmiss-islington
authored andcommitted
Skip test in test_socket.py if sys.getrefcount isn't available (pythonGH-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`. (cherry picked from commit 0f6bb28) Co-authored-by: CF Bolz-Tereick <[email protected]>
1 parent fa3ee75 commit a6b83a8

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
@@ -5328,6 +5328,8 @@ def _testMakefileClose(self):
53285328
self.write_file.write(self.write_msg)
53295329
self.write_file.flush()
53305330

5331+
@unittest.skipUnless(hasattr(sys, 'getrefcount'),
5332+
'test needs sys.getrefcount()')
53315333
def testMakefileCloseSocketDestroy(self):
53325334
refcount_before = sys.getrefcount(self.cli_conn)
53335335
self.read_file.close()

0 commit comments

Comments
 (0)