summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib/fixtures.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_importlib/fixtures.py')
-rw-r--r--Lib/test/test_importlib/fixtures.py16
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