我们从Python开源项目中,提取了以下12个代码示例,用于说明如何使用sys._called_from_test()。
def pytest_configure(config): import sys sys._called_from_test = True
def pytest_configure(config): sys._called_from_test = True # noinspection PyUnusedLocal,SpellCheckingInspection
def pytest_configure(config): sys._called_from_test = True
def pytest_unconfigure(config): if hasattr(sys, '_called_from_test'): del sys._called_from_test
def is_test_mode(): return _TEST_MODE or (hasattr(sys, '_called_from_test') and sys._called_from_test)
def pytest_configure(config): sys._called_from_test = True if os.environ.get('TRAVIS'): import matplotlib matplotlib.use('Agg')