[issue11240] Running unit tests in a command line tool leads to infinite loop with multiprocessing on Windows

Amaury Forgeot d'Arc report at bugs.python.org
Fri Feb 18 18:51:15 CET 2011


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

Nose works correctly for me with multiprocessing. In a directory, I have:

== run_nose.py =================
from nose import main
if __name__ == '__main__':
    main()
================================

== test_me.py ==================
from multiprocessing import Pool
import os, time

def foo(x):
    time.sleep(0.1)
    return (x, os.getpid())

def test_me():
    pool = Pool(processes=4)
    x = pool.map(foo, range(10))
    a, b = zip(*x)
    print a, b
    assert list(a) == range(10)
    assert 1 < len(set(b)) <= 4
================================

Now when I do: "c:\python27\python run_nose.py" the test runs correctly.

Can you try this test in your environment?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11240>
_______________________________________


More information about the Python-bugs-list mailing list