예제 #1
0
def after_step(oCtx, laststep):
    if oCtx._messages:
        # Flush the messages collected with puts(...)
        if hasattr(oCtx.config, 'output'):
            output = oCtx.config.output
            for item in oCtx._messages:
                for line in str(item).splitlines():
                    output.write(u'      %s\n' % (line, ))
            # output.flush()
        elif hasattr(oCtx.config, 'outputs'):
            # FixMe: oCtx.config.outputs is a list of StreamOpener instances
            for output in oCtx.config.outputs:
                if not hasattr(output, 'stream'): continue
                for item in oCtx._messages:
                    for line in str(item).splitlines():
                        output.stream.write(u'      %s\n' % (line, ))
                # output.flush()
        else:
            pass

    if laststep.status == 'failed' and oCtx.config.stop:
        # Enter the interactive debugger
        try:
            tools.set_trace()
        finally:
            # This seems to be *required* - after_all is not called after here.
            vEnvAtexit(oCtx, "after_step calling oMain.vAtexit")
예제 #2
0
def after_step(oCtx, laststep):
    if oCtx._messages:
        # Flush the messages collected with puts(...)
        if hasattr(oCtx.config, 'output'):
            output = oCtx.config.output
            for item in oCtx._messages:
                for line in str(item).splitlines():
                    output.write(u'      %s\n' % (line,))
            # output.flush()
        elif hasattr(oCtx.config, 'outputs'):
            # FixMe: oCtx.config.outputs is a list of StreamOpener instances
            for output in oCtx.config.outputs:
                if not hasattr(output, 'stream'): continue
                for item in oCtx._messages:
                    for line in str(item).splitlines():
                        output.stream.write(u'      %s\n' % (line,))
                # output.flush()
        else:
            pass
        
    if laststep.status == 'failed' and oCtx.config.stop:
        # Enter the interactive debugger
        try:
            tools.set_trace()
        finally:
            # This seems to be *required* - after_all is not called after here.
            vEnvAtexit(oCtx, "after_step calling oMain.vAtexit")
예제 #3
0
def after_step(ctx, laststep):
    if ctx._messages:
        # Flush the messages collected with puts(...)
        for item in ctx._messages:
            for line in str(item).splitlines():
                ctx._output_write(u'      %s\n' % (line,))
        for stream in ctx.config.outputs:
            stream.open().flush()
    if laststep.status == 'failed' and ctx.config.stop:
        # Enter the interactive debugger
        tools.set_trace()
예제 #4
0
def after_step(ctx, laststep):
    if ctx._messages:
        # Flush the messages collected with puts(...)
        for item in ctx._messages:
            for line in str(item).splitlines():
                ctx._output_write(u'      %s\n' % (line, ))
        for stream in ctx.config.outputs:
            stream.open().flush()
    if laststep.status == 'failed' and ctx.config.stop:
        # Enter the interactive debugger
        tools.set_trace()
예제 #5
0
def after_step(ctx, laststep):
    if ctx._messages:
        # Flush the messages collected with puts(...)
        for item in ctx._messages:
            for line in str(item).splitlines():
                ctx._output_write(u'      %s\n' % (line, ))
        for stream in ctx.config.outputs:
            stream.open().flush()

    # stolen from https://pythonhosted.org/behave/tutorial.html
    if BEHAVE_DEBUG_ON_ERROR and laststep.status == 'failed':
        # Enter the interactive debugger
        tools.set_trace()
예제 #6
0
def after_step(ctx, laststep):
    if ctx._messages:
        # Flush the messages collected with puts(...)
        for item in ctx._messages:
            for line in str(item).splitlines():
                ctx._output_write(u'      %s\n' % (line,))
        for stream in ctx.config.outputs:
            stream.open().flush()

    # stolen from https://pythonhosted.org/behave/tutorial.html
    if BEHAVE_DEBUG_ON_ERROR and laststep.status == 'failed':
        # Enter the interactive debugger
        tools.set_trace()