[3.13] gh-121279: Fix importlib DeprecatedAttrsTests (#121319)
https://github.com/python/cpython/commit/ec0f801a7222a256a20d01c99aca69e6aa4... commit: ec0f801a7222a256a20d01c99aca69e6aa4b10ae branch: 3.13 author: Victor Stinner <vstinner@python.org> committer: vstinner <vstinner@python.org> date: 2024-07-03T13:57:05+02:00 summary: [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). files: M Lib/test/test_importlib/test_abc.py 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,
participants (1)
-
vstinner