mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Silence find_module() DeprecationWarning on Windows tests (GH-25563)
This commit is contained in:
parent
1e9f093309
commit
22556d84bc
1 changed files with 4 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue