Пример #1
0
def test_fail_handler_call_from_handler_nest_fail():
    """Failure handler can call to other stepgroups.

    Called step-group has its own failure handler.
    """
    pipename = 'errors/fail-handler-call-from-handler-nest-fail'
    test_pipe_runner.assert_pipeline_raises(
        pipename, AssertionError, 'assert False evaluated to False.',
        ['A', 'B', 'C', 'D'])
Пример #2
0
def test_fail_handler_call_from_handler():
    """Failure handler can call to other stepgroups.

    Still raises at end.
    """
    pipename = 'errors/fail-handler-call-from-handler'
    test_pipe_runner.assert_pipeline_raises(
        pipename, AssertionError, 'assert False evaluated to False.',
        ['A', 'B', 'C', 'D', 'E'])
Пример #3
0
def test_fail_handler_jump():
    """Failure handler can jump to other stepgroups and still raise.

    Even with the jump, still in error context, so without a Stop instruction,
    will quit reporting failure.
    """
    pipename = 'errors/fail-handler-jump'
    test_pipe_runner.assert_pipeline_raises(
        pipename, AssertionError, 'assert False evaluated to False.',
        ['A', 'B', 'C'])
Пример #4
0
def test_fail_handler_call_from_handler_nest_fail_handler():
    """Failure handler can call to other stepgroups.

    Called step-group has its own failure handler.

    Can StopStepGroup the called step-group. The outer/parent failure handler
    does NOT have a stop, so will still raise error.
    """
    pipename = 'errors/fail-handler-call-from-handler-nest-fail-handler'
    test_pipe_runner.assert_pipeline_raises(
        pipename, AssertionError, 'assert False evaluated to False.',
        ['A', 'B', 'C', 'D', 'E', 'F'])
Пример #5
0
def test_fail_handler_also_fails():
    """Failure handler also fails & exits pypyr with original exception."""
    pipename = 'errors/fail-handler-also-fails'
    test_pipe_runner.assert_pipeline_raises(pipename, TypeError, 'O.G err',
                                            ['A'])
Пример #6
0
def test_fail_handler():
    """Failure handler exits pypyr with exception."""
    pipename = 'errors/fail-handler'
    test_pipe_runner.assert_pipeline_raises(pipename, ValueError, 'arb',
                                            ['A', 'B'])