]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-121279: Fix importlib DeprecatedAttrsTests (#121319)
authorVictor Stinner <vstinner@python.org>
Wed, 3 Jul 2024 11:57:05 +0000 (13:57 +0200)
committerGitHub <noreply@github.com>
Wed, 3 Jul 2024 11:57:05 +0000 (13:57 +0200)
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

index 479039055ca75ff42de514a31050fbf33992ae87..1a77773255165b536538e83984623633dcd5e6cc 100644 (file)
@@ -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,