Skip to content

Commit

Permalink
Skip test if there is no sys.getrefcount, like on pypy
Browse files Browse the repository at this point in the history
  • Loading branch information
cfbolz committed Nov 10, 2024
1 parent 450db61 commit 4200653
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Lib/test/test_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -5334,6 +5334,8 @@ def _testMakefileClose(self):
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()
Expand Down

0 comments on commit 4200653

Please sign in to comment.