New issue 58: py.test broken with use of multiprocessing.Process
http://bitbucket.org/hpk42/py-trunk/issue/58/pytest-broken-with-use-of

bluebird75 on Fri, 23 Oct 2009 10:40:28 +0200:

Description:
  The following program clearly highlights the problem:

{{{
#!python

import os
from multiprocessing import Process

def do_task1():
    print 'task1: pid=%d' % (os.getpid())

class TestProcess:

    def test_p1( self ):
        print 'test_p1: pid=%d' % os.getpid()
        p = Process( name='p1', target=do_task1 )
        p.start()
        p.join()

}}}


phili...@pc-philippe /cygdrive/d/work/elc-dev/tmp $ py.test -s                  

============================= test session starts ============================= 
python: platform win32 -- Python 2.6.1                                          
test object 1: d:\work\elc-dev\tmp                                              
                                                                                
test_process.py test_p1: pid=3920                                               
============================= test session starts ============================= 
python: platform win32 -- Python 2.6.1                                          
test object 1: d:\work\elc-dev\tmp                                              
                                                                                
test_process.py test_p1: pid=3344                                               
============================= test session starts ============================= 
python: platform win32 -- Python 2.6.1                                          
test object 1: d:\work\elc-dev\tmp                                              
                                                                                
test_process.py test_p1: pid=208                                                
============================= test session starts ============================= 
python: platform win32 -- Python 2.6.1                                          
test object 1: d:\work\elc-dev\tmp                                              
                                                                                
test_process.py test_p1: pid=3364                                               
============================= test session starts ============================= 
python: platform win32 -- Python 2.6.1                                          
test object 1: d:\work\elc-dev\tmp                                              
                                                                                
test_process.py test_p1: pid=536

...


As you can see, Process() is restarting py.test instead of starting the target 
function.

This is on windows XP, python 2.6.1 . 


Responsible:
  hpk42
-- 
This is an issue notification from bitbucket.org.
You are receiving this either because you are the
owner of the issue, or you are following the issue.
_______________________________________________
py-dev mailing list
py-dev@codespeak.net
http://codespeak.net/mailman/listinfo/py-dev

Reply via email to