本文整理汇总了Python中unittest.TestCase.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python TestCase.__init__方法的具体用法?Python TestCase.__init__怎么用?Python TestCase.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类unittest.TestCase
的用法示例。
在下文中一共展示了TestCase.__init__方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import __init__ [as 别名]
def __init__(self, name, redis_conn):
self.redis_conn = redis_conn
TestCase.__init__(self, name)
示例2: __init__
# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import __init__ [as 别名]
def __init__(self, methodName=None):
TestCase.__init__(self, methodName=methodName)
self.start_time = 0
self.logger = logging.getLogger('APITestBase')
self.logger.setLevel(logging.INFO)
fh = logging.FileHandler('tablestore_sdk_test.log')
fh.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
fh.setFormatter(formatter)
self.logger.addHandler(fh)
示例3: __init__
# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import __init__ [as 别名]
def __init__(self, message, expectedFields):
TestCase.__init__(self)
self.message = message
self.expectedFields = expectedFields
示例4: __init__
# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import __init__ [as 别名]
def __init__(self, *args, **kwargs):
TestCase.__init__(self, *args, **kwargs)
# self.tearDown = lambda: subprocess.call("rm -f *.gz *-symbol.json *.params *.onnx", shell=True)
示例5: __init__
# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import __init__ [as 别名]
def __init__(self, *args, **kwargs):
TestCase.__init__(self, *args, **kwargs)
self.configuration = None
self.enabled = False
self.mock_data = {}
self.expected_data = {}
self.ioc = GreaseContainer()
self.detect = Detect(self.ioc)
示例6: __init__
# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import __init__ [as 别名]
def __init__(self, *args, **kwargs):
TestCase.__init__(self, *args, **kwargs)
registry = Comparison.register()
for k, v in registry.items():
self.addTypeEqualityFunc(k, v)
示例7: __init__
# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import __init__ [as 别名]
def __init__(self, arg):
self.maxDiff = None
TestCase.__init__(self, arg)
示例8: __init__
# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import __init__ [as 别名]
def __init__(self, *args, **kwargs):
TestCase.__init__(self, *args, **kwargs)
if sys.version_info[0] == 2:
self.assertRegex = self.assertRegexpMatches
self._init_env()
示例9: __init__
# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import __init__ [as 别名]
def __init__(self, *args, **kwargs):
TestCase.__init__(self, *args, **kwargs)
alibabacloud.utils._test_flag = True
if sys.version_info[0] == 2:
self.assertRegex = self.assertRegexpMatches
self._sdk_config = self._init_sdk_config()
self.access_key_id = self._read_key_from_env_or_config("ACCESS_KEY_ID")
self.access_key_secret = self._read_key_from_env_or_config("ACCESS_KEY_SECRET")
self.region_id = self._read_key_from_env_or_config("REGION_ID")
self.ecs = self._get_ecs_resource()