Skip to content

Commit

Permalink
[3.13] gh-121279: Fix importlib DeprecatedAttrsTests (#121319)
Browse files Browse the repository at this point in the history
Delete attributes after getting them, so the warning is emitted again
when the test is run multiple times (ex: when checking for reference
leaks).
  • Loading branch information
vstinner committed Jul 3, 2024
1 parent 2516673 commit ec0f801
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Lib/test/test_importlib/test_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ec0f801

Please sign in to comment.