8000 [3.12] Skip test in test_socket.py if `sys.getrefcount` isn't availab… · python/cpython@c47c641 · GitHub
[go: up one dir, main page]

Skip to content

Commit c47c641

Browse files
[3.12] Skip test in test_socket.py if sys.getrefcount isn't available (GH-126640) (#126646)
Skip test in test_socket.py if `sys.getrefcount` isn't available (GH-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 <cfbolz@gmx.de>
1 parent 5030e81 commit c47c641

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
@@ -5261,6 +5261,8 @@ def _testMakefileClose(self):
52615261
self.write_file.write(self.write_msg)
52625262
self.write_file.flush()
52635263

5264+
@unittest.skipUnless(hasattr(sys, 'getrefcount'),
5265+
'test needs sys.getrefcount()')
52645266
def testMakefileCloseSocketDestroy(self):
52655267
refcount_before = sys.getrefcount(self.cli_conn)
52665268
self.read_file.close()

0 commit comments

Comments
 (0)
0