當前位置: 首頁>>代碼示例>>Python>>正文


Python testing.SkipTest方法代碼示例

本文整理匯總了Python中numpy.testing.SkipTest方法的典型用法代碼示例。如果您正苦於以下問題:Python testing.SkipTest方法的具體用法?Python testing.SkipTest怎麽用?Python testing.SkipTest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在numpy.testing的用法示例。


在下文中一共展示了testing.SkipTest方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: setup_module

# 需要導入模塊: from numpy import testing [as 別名]
# 或者: from numpy.testing import SkipTest [as 別名]
def setup_module():
    """
    Build the required testing extension module

    """
    global wrap

    # Check compiler availability first
    if not util.has_c_compiler():
        raise SkipTest("No C compiler available")

    if wrap is None:
        config_code = """
        config.add_extension('test_array_from_pyobj_ext',
                             sources=['wrapmodule.c', 'fortranobject.c'],
                             define_macros=[])
        """
        d = os.path.dirname(__file__)
        src = [os.path.join(d, 'src', 'array_from_pyobj', 'wrapmodule.c'),
               os.path.join(d, '..', 'src', 'fortranobject.c'),
               os.path.join(d, '..', 'src', 'fortranobject.h')]
        wrap = util.build_module_distutils(src, config_code,
                                           'test_array_from_pyobj_ext') 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:25,代碼來源:test_array_from_pyobj.py

示例2: setUp

# 需要導入模塊: from numpy import testing [as 別名]
# 或者: from numpy.testing import SkipTest [as 別名]
def setUp(self):
        if self.module is not None:
            return

        # Check compiler availability first
        if not has_c_compiler():
            raise SkipTest("No C compiler available")

        codes = []
        if self.sources:
            codes.extend(self.sources)
        if self.code is not None:
            codes.append(self.suffix)

        needs_f77 = False
        needs_f90 = False
        for fn in codes:
            if fn.endswith('.f'):
                needs_f77 = True
            elif fn.endswith('.f90'):
                needs_f90 = True
        if needs_f77 and not has_f77_compiler():
            raise SkipTest("No Fortran 77 compiler available")
        if needs_f90 and not has_f90_compiler():
            raise SkipTest("No Fortran 90 compiler available")

        # Build the module
        if self.code is not None:
            self.module = build_code(self.code, options=self.options,
                                     skip=self.skip, only=self.only,
                                     suffix=self.suffix,
                                     module_name=self.module_name)

        if self.sources is not None:
            self.module = build_module(self.sources, options=self.options,
                                       skip=self.skip, only=self.only,
                                       module_name=self.module_name) 
開發者ID:ryfeus,項目名稱:lambda-packs,代碼行數:39,代碼來源:util.py

示例3: setup

# 需要導入模塊: from numpy import testing [as 別名]
# 或者: from numpy.testing import SkipTest [as 別名]
def setup(self):
        if self.module is not None:
            return

        # Check compiler availability first
        if not has_c_compiler():
            raise SkipTest("No C compiler available")

        codes = []
        if self.sources:
            codes.extend(self.sources)
        if self.code is not None:
            codes.append(self.suffix)

        needs_f77 = False
        needs_f90 = False
        for fn in codes:
            if fn.endswith('.f'):
                needs_f77 = True
            elif fn.endswith('.f90'):
                needs_f90 = True
        if needs_f77 and not has_f77_compiler():
            raise SkipTest("No Fortran 77 compiler available")
        if needs_f90 and not has_f90_compiler():
            raise SkipTest("No Fortran 90 compiler available")

        # Build the module
        if self.code is not None:
            self.module = build_code(self.code, options=self.options,
                                     skip=self.skip, only=self.only,
                                     suffix=self.suffix,
                                     module_name=self.module_name)

        if self.sources is not None:
            self.module = build_module(self.sources, options=self.options,
                                       skip=self.skip, only=self.only,
                                       module_name=self.module_name) 
開發者ID:birforce,項目名稱:vnpy_crypto,代碼行數:39,代碼來源:util.py

示例4: setup

# 需要導入模塊: from numpy import testing [as 別名]
# 或者: from numpy.testing import SkipTest [as 別名]
def setup(self):
        if sys.platform == 'win32':
            raise SkipTest('Fails with MinGW64 Gfortran (Issue #9673)')

        if self.module is not None:
            return

        # Check compiler availability first
        if not has_c_compiler():
            raise SkipTest("No C compiler available")

        codes = []
        if self.sources:
            codes.extend(self.sources)
        if self.code is not None:
            codes.append(self.suffix)

        needs_f77 = False
        needs_f90 = False
        for fn in codes:
            if fn.endswith('.f'):
                needs_f77 = True
            elif fn.endswith('.f90'):
                needs_f90 = True
        if needs_f77 and not has_f77_compiler():
            raise SkipTest("No Fortran 77 compiler available")
        if needs_f90 and not has_f90_compiler():
            raise SkipTest("No Fortran 90 compiler available")

        # Build the module
        if self.code is not None:
            self.module = build_code(self.code, options=self.options,
                                     skip=self.skip, only=self.only,
                                     suffix=self.suffix,
                                     module_name=self.module_name)

        if self.sources is not None:
            self.module = build_module(self.sources, options=self.options,
                                       skip=self.skip, only=self.only,
                                       module_name=self.module_name) 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:42,代碼來源:util.py

示例5: setup

# 需要導入模塊: from numpy import testing [as 別名]
# 或者: from numpy.testing import SkipTest [as 別名]
def setup(self):
        if self.tst_locale is None:
            raise SkipTest("No French locale available")
        locale.setlocale(locale.LC_NUMERIC, locale=self.tst_locale) 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:6,代碼來源:_locales.py

示例6: __enter__

# 需要導入模塊: from numpy import testing [as 別名]
# 或者: from numpy.testing import SkipTest [as 別名]
def __enter__(self):
        if self.tst_locale is None:
            raise SkipTest("No French locale available")
        locale.setlocale(locale.LC_NUMERIC, locale=self.tst_locale) 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:6,代碼來源:_locales.py


注:本文中的numpy.testing.SkipTest方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。