コード例 #1
0
ファイル: test_parallel.py プロジェクト: pombredanne/nameko
def test_no_submit_after_shutdown(container):
    pe = ParallelExecutor(container)
    to_call = Mock()
    with pe as execution_context:
        execution_context.submit(to_call, 1)
    with pytest.raises(RuntimeError):
        pe.submit(to_call, 2)
コード例 #2
0
ファイル: test_parallel.py プロジェクト: topiaruss/nameko
def test_no_submit_after_shutdown(container):
    pe = ParallelExecutor(container)
    to_call = Mock()
    with pe as execution_context:
        execution_context.submit(to_call, 1)
    with pytest.raises(RuntimeError):
        pe.submit(to_call, 2)
コード例 #3
0
ファイル: test_parallel.py プロジェクト: pombredanne/nameko
def test_future_gets_exception(container):
    pe = ParallelExecutor(container)

    def raises():
        raise AssertionError()

    future = pe.submit(raises)

    with pytest.raises(AssertionError):
        future.result()
コード例 #4
0
ファイル: test_parallel.py プロジェクト: topiaruss/nameko
def test_future_gets_exception(container):
    pe = ParallelExecutor(container)

    def raises():
        raise AssertionError()

    future = pe.submit(raises)

    with pytest.raises(AssertionError):
        future.result()