本文整理汇总了Python中google3.testing.pybase.parameterized.ParameterizedTestCase方法的典型用法代码示例。如果您正苦于以下问题:Python parameterized.ParameterizedTestCase方法的具体用法?Python parameterized.ParameterizedTestCase怎么用?Python parameterized.ParameterizedTestCase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类google3.testing.pybase.parameterized
的用法示例。
在下文中一共展示了parameterized.ParameterizedTestCase方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __call__
# 需要导入模块: from google3.testing.pybase import parameterized [as 别名]
# 或者: from google3.testing.pybase.parameterized import ParameterizedTestCase [as 别名]
def __call__(self, *args, **kwargs):
raise RuntimeError('You appear to be running a parameterized test case '
'without having inherited from parameterized.'
'ParameterizedTestCase. This is bad because none of '
'your test cases are actually being run.')
示例2: CoopParameterizedTestCase
# 需要导入模块: from google3.testing.pybase import parameterized [as 别名]
# 或者: from google3.testing.pybase.parameterized import ParameterizedTestCase [as 别名]
def CoopParameterizedTestCase(other_base_class):
"""Returns a new base class with a cooperative metaclass base.
This enables the ParameterizedTestCase to be used in combination
with other base classes that have custom metaclasses, such as
mox.MoxTestBase.
Only works with metaclasses that do not override type.__new__.
Example:
import google3
import mox
from google3.testing.pybase import parameterized
class ExampleTest(parameterized.CoopParameterizedTestCase(mox.MoxTestBase)):
...
Args:
other_base_class: (class) A test case base class.
Returns:
A new class object.
"""
metaclass = type(
'CoopMetaclass',
(other_base_class.__metaclass__,
TestGeneratorMetaclass), {})
return metaclass(
'CoopParameterizedTestCase',
(other_base_class, ParameterizedTestCase), {})