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


Python UnitTestUtilities.initializeLogger方法代码示例

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


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

示例1: main

# 需要导入模块: import UnitTestUtilities [as 别名]
# 或者: from UnitTestUtilities import initializeLogger [as 别名]
def main():
    ''' main test logic '''
    if Configuration.DEBUG == True:
        print("TestRunner.py - main")
    else:
        print("Debug messaging is OFF")

    # setup logger
    logName = None
    if not logFileFromBAT == None:
        logName = logFileFromBAT
        Configuration.Logger = UnitTestUtilities.initializeLogger(logFileFromBAT)
    else:
        logName = UnitTestUtilities.getLoggerName()
        Configuration.Logger = UnitTestUtilities.initializeLogger(logName)
    print("Logging results to: " + str(logName))
    UnitTestUtilities.setUpLogFileHeader()

    result = runTestSuite()
    logTestResults(result)
    print("END OF TEST =========================================\n")

    if result.wasSuccessful():
        #tests successful
        sys.exit(0)
    else:
        # test errors or failures
        sys.exit(1)

    return
开发者ID:Esri,项目名称:solutions-webappbuilder-widgets,代码行数:32,代码来源:TestRunner.py

示例2: main

# 需要导入模块: import UnitTestUtilities [as 别名]
# 或者: from UnitTestUtilities import initializeLogger [as 别名]
def main():
    ''' main test logic '''
    print("TestRunner.py - main")

    if Configuration.DEBUG == True:
        print("Debug messaging is ON")
        logLevel = logging.DEBUG
    else:
        print("Debug messaging is OFF")
        logLevel = logging.INFO

    # setup logger
    if not logFileFromBAT == None:
        Configuration.Logger = UnitTestUtilities.initializeLogger(logFileFromBAT, logLevel)
    else:
        Configuration.GetLogger(logLevel)

    print("Logging results to: " + str(Configuration.LoggerFile))
    UnitTestUtilities.setUpLogFileHeader()

    result = runTestSuite()

    logTestResults(result)

    return result.wasSuccessful()
开发者ID:Esri,项目名称:solutions-geoprocessing-toolbox,代码行数:27,代码来源:TestRunner.py

示例3: GetLogger

# 需要导入模块: import UnitTestUtilities [as 别名]
# 或者: from UnitTestUtilities import initializeLogger [as 别名]
def GetLogger(logLevel = logging.DEBUG) :

    global Logger

    if Logger is None:

        import UnitTestUtilities

        logName = UnitTestUtilities.getLoggerName()
        Logger = UnitTestUtilities.initializeLogger(logName, logLevel)

    return Logger
开发者ID:Esri,项目名称:solutions-geoprocessing-toolbox,代码行数:14,代码来源:Configuration.py

示例4: main

# 需要导入模块: import UnitTestUtilities [as 别名]
# 或者: from UnitTestUtilities import initializeLogger [as 别名]
def main():
    logger = UnitTestUtilities.initializeLogger("Base")
    UnitTestUtilities.setUpLogFileHeader(logger)
    runTestSuite()
开发者ID:chinasio,项目名称:solutions-geoprocessing-toolbox,代码行数:6,代码来源:TestRunner.py


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