From 373df46ec7cf045c097ce533266dec6e4345842e Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 3 Jul 2024 12:07:33 +0200 Subject: [PATCH] [3.13] gh-121279: Fix importlib DeprecatedAttrsTests Delete attributes after getting them, so the warning is emitted again when the test is run multiple times (ex: when checking for reference leaks). --- Lib/test/test_importlib/test_abc.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/test/test_importlib/test_abc.py b/Lib/test/test_importlib/test_abc.py index 479039055ca75f..1a77773255165b 100644 --- a/Lib/test/test_importlib/test_abc.py +++ b/Lib/test/test_importlib/test_abc.py @@ -920,14 +920,17 @@ class DeprecatedAttrsTests: def test_deprecated_attr_ResourceReader(self): with self.assertWarns(DeprecationWarning): self.abc.ResourceReader + del self.abc.ResourceReader def test_deprecated_attr_Traversable(self): with self.assertWarns(DeprecationWarning): self.abc.Traversable + del self.abc.Traversable def test_deprecated_attr_TraversableResources(self): with self.assertWarns(DeprecationWarning): self.abc.TraversableResources + del self.abc.TraversableResources (Frozen_DeprecatedAttrsTests,