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