Silence find_module() DeprecationWarning on Windows tests (GH-25563)

This commit is contained in:
Brett Cannon 2021-04-23 14:40:18 -07:00 committed by GitHub
parent 1e9f093309
commit 22556d84bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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):