From: Victor Stinner Date: Wed, 3 Jul 2024 11:57:05 +0000 (+0200) Subject: [3.13] gh-121279: Fix importlib DeprecatedAttrsTests (#121319) X-Git-Tag: v3.13.0b4~127 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ec0f801a7222a256a20d01c99aca69e6aa4b10ae;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-121279: Fix importlib DeprecatedAttrsTests (#121319) Delete attributes after getting them, so the warning is emitted again when the test is run multiple times (ex: when checking for reference leaks). --- diff --git a/Lib/test/test_importlib/test_abc.py b/Lib/test/test_importlib/test_abc.py index 479039055ca7..1a7777325516 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,