How to use the unittest2.TestCase.__init__ function in unittest2

To help you get started, we’ve selected a few unittest2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aliles / begins / tests / test_inspect.py View on Github external
def __init__(self, *args, **kwargs):
        unittest.TestCase.__init__(self, *args, **kwargs)
        if not hasattr(self, 'assertRaisesRegex'):
            self.assertRaisesRegex = self.assertRaisesRegexp
github lyda / chkcrontab / tests / test_check.py View on Github external
def __init__(self, *args):
    unittest.TestCase.__init__(self, *args)
    self._fail_pat = re.compile('FAIL ([0-9]+)')
    self._warn_pat = re.compile('WARN ([0-9]+)')
github aliles / begins / tests / test_inspect.py View on Github external
def __init__(self, *args, **kwargs):
        unittest.TestCase.__init__(self, *args, **kwargs)
        if not hasattr(self, 'assertRaisesRegex'):
            self.assertRaisesRegex = self.assertRaisesRegexp
github aliyun / alibabacloud-python-sdk-v2 / python-function-test / base.py View on Github external
def __init__(self, *args, **kwargs):
        TestCase.__init__(self, *args, **kwargs)
        if sys.version_info[0] == 2:
            self.assertRegex = self.assertRegexpMatches
        self._init_env()
github aliyun / aliyun-openapi-python-sdk / python-sdk-functional-test / base.py View on Github external
def __init__(self, *args, **kwargs):
        TestCase.__init__(self, *args, **kwargs)
        # if sys.version_info[0] == 2:
        #     self.assertRegex = self.assertRegexpMatches
        self._init_env()
github aliyun / alibabacloud-python-sdk-v2 / tests / base.py View on Github external
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()
github nnemkin / sparsedict / tests / mapping_tests.py View on Github external
def __init__(self, *args, **kw):
        unittest.TestCase.__init__(self, *args, **kw)
        self.reference = self._reference().copy()

        # A (key, value) pair not in the mapping
        key, value = self.reference.popitem()
        self.other = {key:value}

        # A (key, value) pair in the mapping
        key, value = self.reference.popitem()
        self.inmapping = {key:value}
        self.reference[key] = value
github aliles / funcsigs / tests / test_inspect.py View on Github external
def __init__(self, *args, **kwargs):
        unittest.TestCase.__init__(self, *args, **kwargs)
        if not hasattr(self, 'assertRaisesRegex'):
            self.assertRaisesRegex = self.assertRaisesRegexp
github aliles / begins / tests / test_inspect.py View on Github external
def __init__(self, *args, **kwargs):
        unittest.TestCase.__init__(self, *args, **kwargs)
        if not hasattr(self, 'assertRaisesRegex'):
            self.assertRaisesRegex = self.assertRaisesRegexp
github python-pillow / Pillow / Tests / helper.py View on Github external
def __init__(self, *args, **kwargs):
        unittest.TestCase.__init__(self, *args, **kwargs)
        self.currentResult = None  # holds last result object passed to run method