https://github.com/python/cpython/commit/ec0f801a7222a256a20d01c99aca69e6aa4b10ae
commit: ec0f801a7222a256a20d01c99aca69e6aa4b10ae
branch: 3.13
author: Victor Stinner <[email protected]>
committer: vstinner <[email protected]>
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,

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to