diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2022-06-26 01:04:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-26 01:04:28 (GMT) |
commit | 38612a05b5de33fde82d7960418527b7cfaa2e7c (patch) | |
tree | fc311ccb634a3bf6fb025bf5b064ead486e7be25 /Lib/test/test_importlib/fixtures.py | |
parent | 9af6b75298d066e89646acf8df1704bef183a6f8 (diff) | |
download | cpython-38612a05b5de33fde82d7960418527b7cfaa2e7c.zip cpython-38612a05b5de33fde82d7960418527b7cfaa2e7c.tar.gz cpython-38612a05b5de33fde82d7960418527b7cfaa2e7c.tar.bz2 |
gh-93259: Validate arg to ``Distribution.from_name``. (GH-94270)
Syncs with importlib_metadata 4.12.0.
Diffstat (limited to 'Lib/test/test_importlib/fixtures.py')
-rw-r--r-- | Lib/test/test_importlib/fixtures.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_importlib/fixtures.py b/Lib/test/test_importlib/fixtures.py index 803d373..e7be77b 100644 --- a/Lib/test/test_importlib/fixtures.py +++ b/Lib/test/test_importlib/fixtures.py @@ -5,6 +5,7 @@ import shutil import pathlib import tempfile import textwrap +import functools import contextlib from test.support.os_helper import FS_NONASCII @@ -296,3 +297,18 @@ class ZipFixtures: # 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 |