summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2021-04-23 21:40:18 (GMT)
committerGitHub <noreply@github.com>2021-04-23 21:40:18 (GMT)
commit22556d84bca68a16e030e2337dcad80069d06f6b (patch)
tree5baf5b94cc183f63f20895451b9ee42e44892196 /Lib/test/test_importlib
parent1e9f0933095403b215c2c4a0be7915d034ff7026 (diff)
downloadcpython-22556d84bca68a16e030e2337dcad80069d06f6b.zip
cpython-22556d84bca68a16e030e2337dcad80069d06f6b.tar.gz
cpython-22556d84bca68a16e030e2337dcad80069d06f6b.tar.bz2
Silence find_module() DeprecationWarning on Windows tests (GH-25563)
Diffstat (limited to 'Lib/test/test_importlib')
-rw-r--r--Lib/test/test_importlib/test_windows.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_importlib/test_windows.py b/Lib/test/test_importlib/test_windows.py
index 802fb34..b243836 100644
--- a/Lib/test/test_importlib/test_windows.py
+++ b/Lib/test/test_importlib/test_windows.py
@@ -5,6 +5,7 @@ import os
import re
import sys
import unittest
+import warnings
from test import support
from test.support import import_helper
from contextlib import contextmanager
@@ -84,7 +85,9 @@ class WindowsRegistryFinderTests:
self.assertIs(spec, None)
def test_find_module_missing(self):
- loader = self.machinery.WindowsRegistryFinder.find_module('spam')
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", DeprecationWarning)
+ loader = self.machinery.WindowsRegistryFinder.find_module('spam')
self.assertIs(loader, None)
def test_module_found(self):