From 2393e2d0efd173e626b01337fb065617cc426ae0 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 25 Feb 2022 17:59:40 +0100 Subject: [PATCH] bpo-46857: Fix test_embed.test_no_memleak() on Windows Tolerate a leak of 1 reference and 1 memory block until it's fixed. --- Lib/test/test_embed.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index e376331063d861..450bbec7005a8e 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -1657,10 +1657,16 @@ def test_no_memleak(self): self.fail(f"unexpected output: {out!a}") refs = int(match.group(1)) blocks = int(match.group(2)) - # bpo-46417: Tolerate negative reference count which can occur because - # of bugs in C extensions. It is only wrong if it's greater than 0. - self.assertLessEqual(refs, 0, out) - self.assertEqual(blocks, 0, out) + if not MS_WINDOWS: + # bpo-46417: Tolerate negative reference count which can occur because + # of bugs in C extensions. It is only wrong if it's greater than 0. + self.assertLessEqual(refs, 0, out) + self.assertEqual(blocks, 0, out) + else: + # bpo-46857: on Windows, Python still leaks 1 reference and 1 + # memory block at exit. + self.assertLessEqual(refs, 1, out) + self.assertIn(blocks, (0, 1), out) class StdPrinterTests(EmbeddingTestsMixin, unittest.TestCase): pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy