mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-43439: Add audit hooks for gc functions (GH-24794)
This commit is contained in:
parent
62a03cd490
commit
b4f9089d4a
6 changed files with 56 additions and 0 deletions
|
@ -118,5 +118,18 @@ class AuditTest(unittest.TestCase):
|
|||
self.assertEqual(events[2][0], "socket.bind")
|
||||
self.assertTrue(events[2][2].endswith("('127.0.0.1', 8080)"))
|
||||
|
||||
def test_gc(self):
|
||||
returncode, events, stderr = self.run_python("test_gc")
|
||||
if returncode:
|
||||
self.fail(stderr)
|
||||
|
||||
if support.verbose:
|
||||
print(*events, sep='\n')
|
||||
self.assertEqual(
|
||||
[event[0] for event in events],
|
||||
["gc.get_objects", "gc.get_referrers", "gc.get_referents"]
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue