mirror of
https://github.com/python/cpython.git
synced 2025-07-30 22:54:16 +00:00
[3.13] Skip test in test_socket.py if sys.getrefcount
isn't available (GH-126640) (#126645)
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 0f6bb28ff3
)
Co-authored-by: CF Bolz-Tereick <cfbolz@gmx.de>
This commit is contained in:
parent
0d3aa25ee4
commit
9473ae9b51
1 changed files with 2 additions and 0 deletions
|
@ -5328,6 +5328,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…
Add table
Add a link
Reference in a new issue