예제 #1
0
def test_taskinthread_exception():
    tasks = qtools.TasksInThread(TestTasks)
    # an exception happens in the thread, there's just a warning message 
    # displayed, the worker thread does not die
    tasks.exception()
    tasks.join()
    # now this raises an exception on the client
    tasks.get_result()
예제 #2
0
파일: test_app.py 프로젝트: goller/qtools
def main0():
    global tasks0, tasks1
    
    tasks0 = qtools.TasksInThread(TestTasks, use_master_thread=False)
    tasks0.squareDone.connect(square_done)
    tasks0.square(3)
    
    tasks1 = qtools.TasksInProcess(TestTasks, use_master_thread=False)
    tasks1.operation(3, 4, coeff=2)
예제 #3
0
def test_tasksinthread_nocallback():
    """Test a task without callback."""
    tasks = qtools.TasksInThread(TestTasks)
    tasks.nocallback(3)
    tasks.join()
    assert tasks.get_result() == 3
예제 #4
0
def test_tasksinthread_operation():
    tasks = qtools.TasksInThread(TestTasks)
    tasks.operation(3, 4, coeff=2)
    tasks.join()
    assert tasks.get_result() == 14
예제 #5
0
def test_tasksinthread_square():
    tasks = qtools.TasksInThread(TestTasks)
    tasks.square(3)
    tasks.join()
    assert tasks.get_result() == 9
예제 #6
0
def test_tasksinprocess_operation():
    tasks = qtools.TasksInThread(TestTasks)
    tasks.operation(3, 4, coeff=2)
    tasks.join()