本文整理匯總了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)