Unit testing multiprocessing code on Windows

Discussion in 'Python' started by Matt Chaput, Feb 17, 2011.

  1. Matt Chaput

    Matt Chaput Guest

    Does anyone know the "right" way to write a unit test for code that uses
    multiprocessing on Windows?

    The problem is that with both "python setup.py tests" and "nosetests",
    when they get to testing any code that starts Processes they spawn
    multiple copies of the testing suite (i.e. the new processes start
    running tests as if they were started with "python setup.py
    tests"/"nosetests"). The test runner in PyDev works properly.

    Maybe multiprocessing is starting new Windows processes by copying the
    command line of the current process? But if the command line is
    "nosetests", it's a one way ticket to an infinite explosion of processes.

    Any thoughts?

    Thanks,

    Matt
     
    Matt Chaput, Feb 17, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt Chaput
    Replies:
    0
    Views:
    224
    Matt Chaput
    Feb 17, 2011
  2. Ulrich Eckhardt

    unit-profiling, similar to unit-testing

    Ulrich Eckhardt, Nov 16, 2011, in forum: Python
    Replies:
    6
    Views:
    336
    Roy Smith
    Nov 18, 2011
  3. Bill Mosteller
    Replies:
    0
    Views:
    230
    Bill Mosteller
    Oct 22, 2009
  4. Avi
    Replies:
    0
    Views:
    497
  5. Avi
    Replies:
    0
    Views:
    468
Loading...

Share This Page