예제 #1
0
def test_pipe_exception_handler():

    class MyException(Exception):
        pass

    with pytest.raises(MyException) as excinfo:

        with pipe_exception_handler('NAME'):

            raise MyException('boo hoo')

    assert excinfo.value.message == "boo hoo\n  in NAME"
예제 #2
0
 def composite(*args, **kwargs):
     with pipe_exception_handler('maybe ?| ' + name):
         result = first(*args, **kwargs)
         return None if result is None else second(result)
예제 #3
0
 def composite(*args, **kwargs):
     with pipe_exception_handler('pipe | ' + name):
         return second(first(*args, **kwargs))
예제 #4
0
파일: main.py 프로젝트: starenka/pipetools
 def composite(*args, **kwargs):
     with pipe_exception_handler('maybe ?| ' + name):
         result = first(*args, **kwargs)
         return None if result is None else second(result)
예제 #5
0
파일: main.py 프로젝트: starenka/pipetools
 def composite(*args, **kwargs):
     with pipe_exception_handler('pipe | ' + name):
         return second(first(*args, **kwargs))