mirror of https://github.com/python/cpython.git
Silence find_module() DeprecationWarning on Windows tests (GH-25563)
This commit is contained in:
parent
1e9f093309
commit
22556d84bc
|
@ -5,6 +5,7 @@
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
import unittest
|
import unittest
|
||||||
|
import warnings
|
||||||
from test import support
|
from test import support
|
||||||
from test.support import import_helper
|
from test.support import import_helper
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
|
@ -84,7 +85,9 @@ def test_find_spec_missing(self):
|
||||||
self.assertIs(spec, None)
|
self.assertIs(spec, None)
|
||||||
|
|
||||||
def test_find_module_missing(self):
|
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)
|
self.assertIs(loader, None)
|
||||||
|
|
||||||
def test_module_found(self):
|
def test_module_found(self):
|
||||||
|
|
Loading…
Reference in New Issue