当前位置: 首页>>代码示例>>Python>>正文


Python sys._called_from_test方法代码示例

本文整理汇总了Python中sys._called_from_test方法的典型用法代码示例。如果您正苦于以下问题:Python sys._called_from_test方法的具体用法?Python sys._called_from_test怎么用?Python sys._called_from_test使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sys的用法示例。


在下文中一共展示了sys._called_from_test方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _jit

# 需要导入模块: import sys [as 别名]
# 或者: from sys import _called_from_test [as 别名]
def _jit(function):
    """
    Compile a function using a jit compiler.

    The function is always compiled to check errors, but is only used outside
    tests, so that code coverage analysis can be performed in jitted functions.

    The tests set sys._called_from_test in conftest.py.

    """
    import sys

    compiled = numba.jit(function)

    if hasattr(sys, '_called_from_test'):
        return function
    else:  # pragma: no cover
        return compiled 
开发者ID:vnmabus,项目名称:dcor,代码行数:20,代码来源:_utils.py

示例2: setUpClass

# 需要导入模块: import sys [as 别名]
# 或者: from sys import _called_from_test [as 别名]
def setUpClass(cls):
        "Initialise parts of wxGlade before individual tests starts"
        # set icon path back to the default default
        #config.icons_path = 'icons'

        # initialise wxGlade preferences and set some useful values
        common.init_preferences()
        config.preferences.autosave = False
        config.preferences.write_timestamp = False
        config.preferences.show_progress = False
        #config.version = '"faked test version"'

        # make e.g. the preview raise Exceptions
        config.testing = True

        # Determinate case and output directory
        cls.caseDirectory = os.path.join( os.path.dirname(__file__), cls.caseDirectory )
        cls.outDirectory  = os.path.join( os.path.dirname(__file__), cls.outDirectory )
        if not os.path.exists(cls.outDirectory): os.mkdir(cls.outDirectory)

        # disable bug dialogs
        sys._called_from_test = True 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:24,代码来源:testsupport_new.py

示例3: pytest_configure

# 需要导入模块: import sys [as 别名]
# 或者: from sys import _called_from_test [as 别名]
def pytest_configure(config):
    import sys

    sys._called_from_test = True 
开发者ID:simonw,项目名称:datasette,代码行数:6,代码来源:conftest.py

示例4: pytest_configure

# 需要导入模块: import sys [as 别名]
# 或者: from sys import _called_from_test [as 别名]
def pytest_configure(config):
    sys._called_from_test = True 
开发者ID:danijar,项目名称:mindpark,代码行数:4,代码来源:conftest.py

示例5: pytest_configure

# 需要导入模块: import sys [as 别名]
# 或者: from sys import _called_from_test [as 别名]
def pytest_configure(config):
    import sys
    sys._called_from_test = True 
开发者ID:vnmabus,项目名称:dcor,代码行数:5,代码来源:conftest.py

示例6: pytest_configure

# 需要导入模块: import sys [as 别名]
# 或者: from sys import _called_from_test [as 别名]
def pytest_configure(config):
    """set pytest sentinel"""
    import sys
    sys._called_from_test = True 
开发者ID:KxSystems,项目名称:pyq,代码行数:6,代码来源:conftest.py

示例7: pytest_unconfigure

# 需要导入模块: import sys [as 别名]
# 或者: from sys import _called_from_test [as 别名]
def pytest_unconfigure(config):
    if hasattr(sys, '_called_from_test'):
        del sys._called_from_test 
开发者ID:coin-or,项目名称:python-mip,代码行数:5,代码来源:conftest.py

示例8: pytest_configure

# 需要导入模块: import sys [as 别名]
# 或者: from sys import _called_from_test [as 别名]
def pytest_configure(config):
    import sys

    sys._called_from_test = True
    config.addinivalue_line("markers", "example: Mark a given test as an example which can be run")
    config.addinivalue_line(
        "markers", "slow: Mark a given test as slower than most other tests, needing a special " "flag to run."
    ) 
开发者ID:MolSSI,项目名称:QCFractal,代码行数:10,代码来源:testing.py


注:本文中的sys._called_from_test方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。