summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib
diff options
context:
space:
mode:
authorShreyan Avigyan <shreyan.avigyan@gmail.com>2021-04-27 15:56:08 (GMT)
committerGitHub <noreply@github.com>2021-04-27 15:56:08 (GMT)
commite3bf179642a3445fb079454f382b93d0177f5012 (patch)
tree81de69ee5134b644b3e748a21ec18414cd8c096a /Lib/test/test_importlib
parent99fdd782007db86f20aeb302b2ceaf79ce1ae2ba (diff)
downloadcpython-e3bf179642a3445fb079454f382b93d0177f5012.zip
cpython-e3bf179642a3445fb079454f382b93d0177f5012.tar.gz
cpython-e3bf179642a3445fb079454f382b93d0177f5012.tar.bz2
bpo-43864: Silence deprecation warning in test_importlib.test_module_found and test_importlib.test_module_not_found (GH-25656)
Diffstat (limited to 'Lib/test/test_importlib')
-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 b243836..6f09c5a 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)