Beispiel #1
0
def pytest_configure(config):
    config.addinivalue_line(
        'markers', "mp_group('GroupName', strategy): test (suite) is in named "
        "grouped w/ desired strategy: 'free' (default), 'serial', "
        "'isolated_free', or 'isolated_serial'.")

    if config.option.use_mp is None:
        if not config.getini('mp'):
            return

    standard_reporter = config.pluginmanager.get_plugin('terminalreporter')
    if standard_reporter:
        from pytest_mp.terminal import MPTerminalReporter
        mp_reporter = MPTerminalReporter(standard_reporter)
        config.pluginmanager.unregister(standard_reporter)
        config.pluginmanager.register(mp_reporter, 'terminalreporter')

    if config.option.xmlpath is not None:
        from pytest_mp.junitxml import MPLogXML
        synchronization['node_reporters'] = manager.list()
        synchronization['node_reporters_lock'] = manager.Lock()
        xmlpath = config.option.xmlpath
        config.pluginmanager.unregister(config._xml)
        config._xml = MPLogXML(xmlpath, config.option.junitprefix,
                               config.getini("junit_suite_name"))
        config.pluginmanager.register(config._xml, 'mpjunitxml')
Beispiel #2
0
def pytest_configure(config):
    if config.option.use_mp is None:
        if not config.getini('mp'):
            return False

    standard_reporter = config.pluginmanager.get_plugin('terminalreporter')
    if standard_reporter:
        from pytest_mp.terminal import MPTerminalReporter
        mp_reporter = MPTerminalReporter(standard_reporter)
        config.pluginmanager.unregister(standard_reporter)
        config.pluginmanager.register(mp_reporter, 'mpterminalreporter')

    if config.option.xmlpath is not None:
        from pytest_mp.junitxml import MPLogXML
        synchronization['node_reporters'] = manager.list()
        synchronization['node_reporters_lock'] = manager.Lock()
        xmlpath = config.option.xmlpath
        config.pluginmanager.unregister(config._xml)
        config._xml = MPLogXML(xmlpath, config.option.junitprefix,
                               config.getini("junit_suite_name"))
        config.pluginmanager.register(config._xml, 'mpjunitxml')