paramview#

class Parameters(**kwargs: Any)#

Bases: object

Store parameters for a single test instance (job)

Examples

>>> p = Parameters(a=1, b=2, c=3)
>>> p['a']
1
>>> assert p.a == p['a']
>>> p[('a', 'b')]
(1, 2)
>>> assert p['a,b'] == p[('a', 'b')]
>>> p[('b', 'c', 'a')]
(2, 3, 1)
multi_index(arg: tuple[str, ...] | str) tuple[int, ...] | int | None#
items() Generator[Any, None, None]#
keys() list[str]#
values() list[Any]#
get(key: str, default: Any | None = None) Any | None#
asdict() dict[str, Any]#
class MultiParameters(**kwargs: Any)#

Bases: Parameters

Store parameters for a single test instance (job)

Examples

>>> p = Parameters(a=[1, 2, 3], b=[4, 5, 6], c=[7, 8, 9])
>>> a = p['a']
>>> a
(1, 2, 3)
>>> b = p['b']
>>> b
(4, 5, 6)
>>> for i, values in enumerate(p[('a', 'b')]):
...     assert values == (a[i], b[i])
...     print(values)
(1, 4)
(2, 5)

As a consequence of the above, note the following:

>>> x = p[('a',)]
>>> x
((1,), (2,), (3,))

etc.