gh-93259: Validate arg to `Distribution.from_name`. (GH-94270)

Syncs with importlib_metadata 4.12.0.
This commit is contained in:
Jason R. Coombs 2022-06-25 21:04:28 -04:00 committed by GitHub
parent 9af6b75298
commit 38612a05b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 135 additions and 67 deletions

View file

@ -5,6 +5,7 @@
import pathlib
import tempfile
import textwrap
import functools
import contextlib
from test.support.os_helper import FS_NONASCII
@ -296,3 +297,18 @@ def setUp(self):
# Add self.zip_name to the front of sys.path.
self.resources = contextlib.ExitStack()
self.addCleanup(self.resources.close)
def parameterize(*args_set):
"""Run test method with a series of parameters."""
def wrapper(func):
@functools.wraps(func)
def _inner(self):
for args in args_set:
with self.subTest(**args):
func(self, **args)
return _inner
return wrapper