예제 #1
0
    def test_coroutine():
        dummy = Dummy()
        wref[0] = weakref.ref(dummy)

        yield d_ctrl_1  # pause for state inspection

        noreturn(other_coroutine())
        never_called[0] = False
예제 #2
0
    def fn():
        fn_called[0] = True
        try:
            yield fail(MockException())
        except MockException:
            pass

        noreturn(fn2())
예제 #3
0
파일: tests.py 프로젝트: eallik/txcoroutine
    def test_coroutine():
        dummy = Dummy()
        wref[0] = weakref.ref(dummy)

        yield d_ctrl_1  # pause for state inspection

        noreturn(other_coroutine())
        never_called[0] = False
예제 #4
0
파일: tests.py 프로젝트: eallik/txcoroutine
    def fn():
        fn_called[0] = True
        try:
            yield fail(MockException())
        except MockException:
            pass

        noreturn(fn2())
예제 #5
0
 def fn():
     yield
     noreturn(fn2())
     after_noreturn_reached[0] = True
예제 #6
0
 def fact(n, result=1):
     if n <= 1:
         returnValue(result)
     else:
         noreturn(fact(n - 1, n * result))
     yield
예제 #7
0
파일: tests.py 프로젝트: eallik/txcoroutine
 def fn():
     yield
     noreturn(fn2())
     after_noreturn_reached[0] = True
예제 #8
0
파일: tests.py 프로젝트: eallik/txcoroutine
 def fact(n, result=1):
     if n <= 1:
         returnValue(result)
     else:
         noreturn(fact(n - 1, n * result))
     yield