unittest-parametrize 1.7.0__tar.gz → 1.8.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {unittest_parametrize-1.7.0 → unittest_parametrize-1.8.0}/CHANGELOG.rst +22 -0
- {unittest_parametrize-1.7.0/src/unittest_parametrize.egg-info → unittest_parametrize-1.8.0}/PKG-INFO +24 -4
- {unittest_parametrize-1.7.0 → unittest_parametrize-1.8.0}/README.rst +22 -3
- {unittest_parametrize-1.7.0 → unittest_parametrize-1.8.0}/pyproject.toml +3 -2
- {unittest_parametrize-1.7.0 → unittest_parametrize-1.8.0}/src/unittest_parametrize/__init__.py +6 -3
- {unittest_parametrize-1.7.0 → unittest_parametrize-1.8.0/src/unittest_parametrize.egg-info}/PKG-INFO +24 -4
- {unittest_parametrize-1.7.0 → unittest_parametrize-1.8.0}/LICENSE +0 -0
- {unittest_parametrize-1.7.0 → unittest_parametrize-1.8.0}/MANIFEST.in +0 -0
- {unittest_parametrize-1.7.0 → unittest_parametrize-1.8.0}/setup.cfg +0 -0
- {unittest_parametrize-1.7.0 → unittest_parametrize-1.8.0}/src/unittest_parametrize/py.typed +0 -0
- {unittest_parametrize-1.7.0 → unittest_parametrize-1.8.0}/src/unittest_parametrize.egg-info/SOURCES.txt +0 -0
- {unittest_parametrize-1.7.0 → unittest_parametrize-1.8.0}/src/unittest_parametrize.egg-info/dependency_links.txt +0 -0
- {unittest_parametrize-1.7.0 → unittest_parametrize-1.8.0}/src/unittest_parametrize.egg-info/requires.txt +0 -0
- {unittest_parametrize-1.7.0 → unittest_parametrize-1.8.0}/src/unittest_parametrize.egg-info/top_level.txt +0 -0
@@ -2,6 +2,28 @@
|
|
2
2
|
Changelog
|
3
3
|
=========
|
4
4
|
|
5
|
+
1.8.0 (2025-09-09)
|
6
|
+
------------------
|
7
|
+
|
8
|
+
* Support Python 3.14.
|
9
|
+
|
10
|
+
* Add support for providing single parameter values without wrapping tuples, such as:
|
11
|
+
|
12
|
+
.. code-block:: python
|
13
|
+
|
14
|
+
from unittest_parametrize import ParametrizedTestCase, parametrize
|
15
|
+
|
16
|
+
|
17
|
+
class EqualTests(ParametrizedTestCase):
|
18
|
+
@parametrize(
|
19
|
+
"x",
|
20
|
+
[1, 2, 3],
|
21
|
+
)
|
22
|
+
def test_equal(self, x: int) -> None:
|
23
|
+
self.assertEqual(x, x)
|
24
|
+
|
25
|
+
Thanks to Jirka Borovec for the report in `Issue #146 <https://github.com/adamchainz/unittest-parametrize/issues/146>`__.
|
26
|
+
|
5
27
|
1.7.0 (2025-08-27)
|
6
28
|
------------------
|
7
29
|
|
{unittest_parametrize-1.7.0/src/unittest_parametrize.egg-info → unittest_parametrize-1.8.0}/PKG-INFO
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: unittest-parametrize
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.8.0
|
4
4
|
Summary: Parametrize tests within unittest TestCases.
|
5
5
|
Author-email: Adam Johnson <me@adamj.eu>
|
6
6
|
License-Expression: MIT
|
@@ -17,6 +17,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.11
|
18
18
|
Classifier: Programming Language :: Python :: 3.12
|
19
19
|
Classifier: Programming Language :: Python :: 3.13
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
20
21
|
Classifier: Typing :: Typed
|
21
22
|
Requires-Python: >=3.9
|
22
23
|
Description-Content-Type: text/x-rst
|
@@ -59,7 +60,7 @@ Install with:
|
|
59
60
|
|
60
61
|
python -m pip install unittest-parametrize
|
61
62
|
|
62
|
-
Python 3.9 to 3.
|
63
|
+
Python 3.9 to 3.14 supported.
|
63
64
|
|
64
65
|
Usage
|
65
66
|
=====
|
@@ -77,8 +78,8 @@ There are two steps to parametrize a test case:
|
|
77
78
|
2. Apply ``@parametrize`` to any test methods for parametrization.
|
78
79
|
This decorator takes (at least):
|
79
80
|
|
80
|
-
* the argument names to parametrize, as comma-separated string
|
81
|
-
* a list of
|
81
|
+
* the argument names to parametrize, as comma-separated string or sequence of strings.
|
82
|
+
* a list of parameters to create individual tests for, which may be tuples, ``param`` objects, or single values (for one argument).
|
82
83
|
|
83
84
|
Here’s a basic example:
|
84
85
|
|
@@ -106,6 +107,25 @@ It supports both synchronous and asynchronous test methods.
|
|
106
107
|
.. |__init_subclass__ hook| replace:: ``__init_subclass__`` hook
|
107
108
|
__ https://docs.python.org/3/reference/datamodel.html#object.__init_subclass__
|
108
109
|
|
110
|
+
Provide a single parameter without a wrapping tuple
|
111
|
+
---------------------------------------------------
|
112
|
+
|
113
|
+
If you only need a single parameter, you can provide values without wrapping them in tuples:
|
114
|
+
|
115
|
+
.. code-block:: python
|
116
|
+
|
117
|
+
from unittest_parametrize import ParametrizedTestCase, parametrize
|
118
|
+
|
119
|
+
|
120
|
+
class EqualTests(ParametrizedTestCase):
|
121
|
+
@parametrize(
|
122
|
+
"x",
|
123
|
+
[1, 2, 3],
|
124
|
+
)
|
125
|
+
def test_equal(self, x: int) -> None:
|
126
|
+
self.assertEqual(x, x)
|
127
|
+
|
128
|
+
|
109
129
|
Provide argument names as separate strings
|
110
130
|
------------------------------------------
|
111
131
|
|
@@ -33,7 +33,7 @@ Install with:
|
|
33
33
|
|
34
34
|
python -m pip install unittest-parametrize
|
35
35
|
|
36
|
-
Python 3.9 to 3.
|
36
|
+
Python 3.9 to 3.14 supported.
|
37
37
|
|
38
38
|
Usage
|
39
39
|
=====
|
@@ -51,8 +51,8 @@ There are two steps to parametrize a test case:
|
|
51
51
|
2. Apply ``@parametrize`` to any test methods for parametrization.
|
52
52
|
This decorator takes (at least):
|
53
53
|
|
54
|
-
* the argument names to parametrize, as comma-separated string
|
55
|
-
* a list of
|
54
|
+
* the argument names to parametrize, as comma-separated string or sequence of strings.
|
55
|
+
* a list of parameters to create individual tests for, which may be tuples, ``param`` objects, or single values (for one argument).
|
56
56
|
|
57
57
|
Here’s a basic example:
|
58
58
|
|
@@ -80,6 +80,25 @@ It supports both synchronous and asynchronous test methods.
|
|
80
80
|
.. |__init_subclass__ hook| replace:: ``__init_subclass__`` hook
|
81
81
|
__ https://docs.python.org/3/reference/datamodel.html#object.__init_subclass__
|
82
82
|
|
83
|
+
Provide a single parameter without a wrapping tuple
|
84
|
+
---------------------------------------------------
|
85
|
+
|
86
|
+
If you only need a single parameter, you can provide values without wrapping them in tuples:
|
87
|
+
|
88
|
+
.. code-block:: python
|
89
|
+
|
90
|
+
from unittest_parametrize import ParametrizedTestCase, parametrize
|
91
|
+
|
92
|
+
|
93
|
+
class EqualTests(ParametrizedTestCase):
|
94
|
+
@parametrize(
|
95
|
+
"x",
|
96
|
+
[1, 2, 3],
|
97
|
+
)
|
98
|
+
def test_equal(self, x: int) -> None:
|
99
|
+
self.assertEqual(x, x)
|
100
|
+
|
101
|
+
|
83
102
|
Provide argument names as separate strings
|
84
103
|
------------------------------------------
|
85
104
|
|
@@ -6,7 +6,7 @@ requires = [
|
|
6
6
|
|
7
7
|
[project]
|
8
8
|
name = "unittest-parametrize"
|
9
|
-
version = "1.
|
9
|
+
version = "1.8.0"
|
10
10
|
description = "Parametrize tests within unittest TestCases."
|
11
11
|
readme = "README.rst"
|
12
12
|
keywords = [
|
@@ -28,6 +28,7 @@ classifiers = [
|
|
28
28
|
"Programming Language :: Python :: 3.11",
|
29
29
|
"Programming Language :: Python :: 3.12",
|
30
30
|
"Programming Language :: Python :: 3.13",
|
31
|
+
"Programming Language :: Python :: 3.14",
|
31
32
|
"Typing :: Typed",
|
32
33
|
]
|
33
34
|
dependencies = [
|
@@ -83,7 +84,7 @@ lint.extend-safe-fixes = [
|
|
83
84
|
lint.isort.required-imports = [ "from __future__ import annotations" ]
|
84
85
|
|
85
86
|
[tool.pyproject-fmt]
|
86
|
-
max_supported_python = "3.
|
87
|
+
max_supported_python = "3.14"
|
87
88
|
|
88
89
|
[tool.pytest.ini_options]
|
89
90
|
addopts = """\
|
{unittest_parametrize-1.7.0 → unittest_parametrize-1.8.0}/src/unittest_parametrize/__init__.py
RENAMED
@@ -120,7 +120,7 @@ TestFunc = Callable[P, T]
|
|
120
120
|
|
121
121
|
def parametrize(
|
122
122
|
argnames: str | Sequence[str],
|
123
|
-
argvalues: Sequence[tuple[Any, ...] | param],
|
123
|
+
argvalues: Sequence[tuple[Any, ...] | param | Any],
|
124
124
|
ids: Sequence[str | None] | Callable[[Any], str | None] | None = None,
|
125
125
|
) -> Callable[[Callable[P, T]], Callable[P, T]]:
|
126
126
|
if isinstance(argnames, str):
|
@@ -158,10 +158,13 @@ def parametrize(
|
|
158
158
|
raise ValueError(f"Duplicate param id {argvalue.id!r}")
|
159
159
|
seen_ids.add(argvalue.id)
|
160
160
|
params.append(argvalue)
|
161
|
-
|
161
|
+
elif len(argnames) == 1:
|
162
|
+
argvalue = param(argvalue, id=make_id(i, (argvalue,), ids))
|
163
|
+
seen_ids.add(argvalue.id)
|
164
|
+
params.append(argvalue)
|
162
165
|
else:
|
163
166
|
raise TypeError(
|
164
|
-
f"argvalue at index {i} is not a tuple or
|
167
|
+
f"argvalue at index {i} is not a tuple, param instance, or single value: {argvalue!r}"
|
165
168
|
)
|
166
169
|
|
167
170
|
_parametrized = parametrized(argnames, params)
|
{unittest_parametrize-1.7.0 → unittest_parametrize-1.8.0/src/unittest_parametrize.egg-info}/PKG-INFO
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: unittest-parametrize
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.8.0
|
4
4
|
Summary: Parametrize tests within unittest TestCases.
|
5
5
|
Author-email: Adam Johnson <me@adamj.eu>
|
6
6
|
License-Expression: MIT
|
@@ -17,6 +17,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.11
|
18
18
|
Classifier: Programming Language :: Python :: 3.12
|
19
19
|
Classifier: Programming Language :: Python :: 3.13
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
20
21
|
Classifier: Typing :: Typed
|
21
22
|
Requires-Python: >=3.9
|
22
23
|
Description-Content-Type: text/x-rst
|
@@ -59,7 +60,7 @@ Install with:
|
|
59
60
|
|
60
61
|
python -m pip install unittest-parametrize
|
61
62
|
|
62
|
-
Python 3.9 to 3.
|
63
|
+
Python 3.9 to 3.14 supported.
|
63
64
|
|
64
65
|
Usage
|
65
66
|
=====
|
@@ -77,8 +78,8 @@ There are two steps to parametrize a test case:
|
|
77
78
|
2. Apply ``@parametrize`` to any test methods for parametrization.
|
78
79
|
This decorator takes (at least):
|
79
80
|
|
80
|
-
* the argument names to parametrize, as comma-separated string
|
81
|
-
* a list of
|
81
|
+
* the argument names to parametrize, as comma-separated string or sequence of strings.
|
82
|
+
* a list of parameters to create individual tests for, which may be tuples, ``param`` objects, or single values (for one argument).
|
82
83
|
|
83
84
|
Here’s a basic example:
|
84
85
|
|
@@ -106,6 +107,25 @@ It supports both synchronous and asynchronous test methods.
|
|
106
107
|
.. |__init_subclass__ hook| replace:: ``__init_subclass__`` hook
|
107
108
|
__ https://docs.python.org/3/reference/datamodel.html#object.__init_subclass__
|
108
109
|
|
110
|
+
Provide a single parameter without a wrapping tuple
|
111
|
+
---------------------------------------------------
|
112
|
+
|
113
|
+
If you only need a single parameter, you can provide values without wrapping them in tuples:
|
114
|
+
|
115
|
+
.. code-block:: python
|
116
|
+
|
117
|
+
from unittest_parametrize import ParametrizedTestCase, parametrize
|
118
|
+
|
119
|
+
|
120
|
+
class EqualTests(ParametrizedTestCase):
|
121
|
+
@parametrize(
|
122
|
+
"x",
|
123
|
+
[1, 2, 3],
|
124
|
+
)
|
125
|
+
def test_equal(self, x: int) -> None:
|
126
|
+
self.assertEqual(x, x)
|
127
|
+
|
128
|
+
|
109
129
|
Provide argument names as separate strings
|
110
130
|
------------------------------------------
|
111
131
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|