summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShreyan Avigyan <shreyan.avigyan@gmail.com>2021-04-27 21:26:08 +0530
committerGitHub <noreply@github.com>2021-04-27 16:56:08 +0100
commite3bf179642a3445fb079454f382b93d0177f5012 (patch)
tree81de69ee5134b644b3e748a21ec18414cd8c096a
parent99fdd782007db86f20aeb302b2ceaf79ce1ae2ba (diff)
downloadcpython-git-e3bf179642a3445fb079454f382b93d0177f5012.tar.gz
bpo-43864: Silence deprecation warning in test_importlib.test_module_found and test_importlib.test_module_not_found (GH-25656)
-rw-r--r--Lib/test/test_importlib/test_windows.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_importlib/test_windows.py b/Lib/test/test_importlib/test_windows.py
index b24383618c..6f09c5a7a5 100644
--- a/Lib/test/test_importlib/test_windows.py
+++ b/Lib/test/test_importlib/test_windows.py
@@ -92,14 +92,18 @@ class WindowsRegistryFinderTests:
def test_module_found(self):
with setup_module(self.machinery, self.test_module):
- loader = self.machinery.WindowsRegistryFinder.find_module(self.test_module)
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", DeprecationWarning)
+ loader = self.machinery.WindowsRegistryFinder.find_module(self.test_module)
spec = self.machinery.WindowsRegistryFinder.find_spec(self.test_module)
self.assertIsNot(loader, None)
self.assertIsNot(spec, None)
def test_module_not_found(self):
with setup_module(self.machinery, self.test_module, path="."):
- loader = self.machinery.WindowsRegistryFinder.find_module(self.test_module)
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", DeprecationWarning)
+ loader = self.machinery.WindowsRegistryFinder.find_module(self.test_module)
spec = self.machinery.WindowsRegistryFinder.find_spec(self.test_module)
self.assertIsNone(loader)
self.assertIsNone(spec)