10000 Silence find_module() DeprecationWarning on Windows tests (GH-25563) · python/cpython@22556d8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 22556d8

Browse files
authored
Silence find_module() DeprecationWarning on Windows tests (GH-25563)
1 parent 1e9f093 commit 22556d8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/test/test_importlib/test_windows.py

Lines changed: 4 additions & 1 deletion
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)
0