mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-121604: Make sure all deprecated items in importlib raise DeprecationWarning (#128007)
Co-authored-by: rashansmith <smith.rashan@gmail.com> Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Brett Cannon <brett@python.org>
This commit is contained in:
parent
b52de22ac3
commit
bd3baa8b1a
8 changed files with 96 additions and 5 deletions
|
@ -104,6 +104,12 @@ class WindowsRegistryFinderTests:
|
|||
spec = self.machinery.WindowsRegistryFinder.find_spec(self.test_module)
|
||||
self.assertIsNone(spec)
|
||||
|
||||
def test_raises_deprecation_warning(self):
|
||||
# WindowsRegistryFinder is not meant to be instantiated, so the
|
||||
# deprecation warning is raised in the 'find_spec' method instead.
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
self.machinery.WindowsRegistryFinder.find_spec('spam')
|
||||
|
||||
(Frozen_WindowsRegistryFinderTests,
|
||||
Source_WindowsRegistryFinderTests
|
||||
) = test_util.test_both(WindowsRegistryFinderTests, machinery=machinery)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue