diff options
author | Brett Cannon <brett@python.org> | 2021-04-23 14:40:18 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-23 14:40:18 -0700 |
commit | 22556d84bca68a16e030e2337dcad80069d06f6b (patch) | |
tree | 5baf5b94cc183f63f20895451b9ee42e44892196 /Lib | |
parent | 1e9f0933095403b215c2c4a0be7915d034ff7026 (diff) | |
download | cpython-git-22556d84bca68a16e030e2337dcad80069d06f6b.tar.gz |
Silence find_module() DeprecationWarning on Windows tests (GH-25563)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_importlib/test_windows.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_importlib/test_windows.py b/Lib/test/test_importlib/test_windows.py index 802fb34d81..b24383618c 100644 --- a/Lib/test/test_importlib/test_windows.py +++ b/Lib/test/test_importlib/test_windows.py @@ -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): |