本文整理汇总了Python中google3.testing.pybase.parameterized.Parameters方法的典型用法代码示例。如果您正苦于以下问题:Python parameterized.Parameters方法的具体用法?Python parameterized.Parameters怎么用?Python parameterized.Parameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类google3.testing.pybase.parameterized
的用法示例。
在下文中一共展示了parameterized.Parameters方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Parameters
# 需要导入模块: from google3.testing.pybase import parameterized [as 别名]
# 或者: from google3.testing.pybase.parameterized import Parameters [as 别名]
def Parameters(*testcases):
"""A decorator for creating parameterized tests.
See the module docstring for a usage example.
Args:
*testcases: Parameters for the decorated method, either a single
iterable, or a list of tuples/dicts/objects (for tests
with only one argument).
Returns:
A test generator to be handled by TestGeneratorMetaclass.
"""
return _ParameterDecorator(_ARGUMENT_REPR, testcases)
示例2: NamedParameters
# 需要导入模块: from google3.testing.pybase import parameterized [as 别名]
# 或者: from google3.testing.pybase.parameterized import Parameters [as 别名]
def NamedParameters(*testcases):
"""A decorator for creating parameterized tests.
See the module docstring for a usage example. The first element of
each parameter tuple should be a string and will be appended to the
name of the test method.
Args:
*testcases: Parameters for the decorated method, either a single
iterable, or a list of tuples.
Returns:
A test generator to be handled by TestGeneratorMetaclass.
"""
return _ParameterDecorator(_FIRST_ARG, testcases)