mirror of
https://github.com/python/cpython.git
synced 2025-11-01 14:11:41 +00:00
gh-93259: Validate arg to `Distribution.from_name`. (GH-94270)
Syncs with importlib_metadata 4.12.0.
This commit is contained in:
parent
9af6b75298
commit
38612a05b5
6 changed files with 135 additions and 67 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue