diff -r 2cfef775f518 -r 64c62ac8f65d tests/multiprocess.py --- a/tests/multiprocess.py Fri Mar 15 15:13:42 2013 +0100 +++ b/tests/multiprocess.py Tue Mar 19 16:45:37 2013 +0100 @@ -9,7 +9,7 @@ where it was created -- no sharing between processes. get_conn and cursor will still work after fork. Connections from parent process will -be forgotten, that cannot be used un child process. +be forgotten, that cannot be used un child process. Connections cannot be shared between processes, DO NOT: * get_conn, then fork, then put_conn @@ -25,7 +25,7 @@ import multiprocessing -from config import Config +from tests.config import Config from pgtoolkit import pgmanager @@ -52,12 +52,12 @@ pgm.create_conn(**cfg) with pgm.cursor() as curs: - print('[%d] pgconn: %d' % (multiprocessing.current_process().pid, curs.connection.get_backend_pid())) + print('[%d] pgconn: %d' % (multiprocessing.current_process().pid, curs.connection.get_backend_pid())) print('[%d] insert' % multiprocessing.current_process().pid) curs.execute('''INSERT INTO test (name) VALUES ('multi') RETURNING id''') id = curs.fetchone()[0] curs.connection.commit() - + print('[%d] update' % multiprocessing.current_process().pid) curs.execute('''UPDATE test SET name = 'multi-main' WHERE id=%s''', [id]) # not committed