Skip to content

Commit d2d2fa0

Browse files
committed
Silence find_module() DeprecationWarning on Windows tests
1 parent f24e2e5 commit d2d2fa0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/test/test_importlib/test_windows.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import re
66
import sys
77
import unittest
8+
import warnings
89
from test import support
910
from test.support import import_helper
1011
from contextlib import contextmanager
@@ -84,7 +85,9 @@ def test_find_spec_missing(self):
8485
self.assertIs(spec, None)
8586

8687
def test_find_module_missing(self):
87-
loader = self.machinery.WindowsRegistryFinder.find_module('spam')
88+
with warnings.catch_warnings():
89+
warnings.simplefilter("ignore", DeprecationWarning)
90+
loader = self.machinery.WindowsRegistryFinder.find_module('spam')
8891
self.assertIs(loader, None)
8992

9093
def test_module_found(self):

0 commit comments

Comments
 (0)