[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).
This commit is contained in:
Victor Stinner 2024-07-03 13:57:05 +02:00 committed by GitHub
parent 251667340e
commit ec0f801a72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View 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,