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. Advertisements

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. Veloso
    Replies:
    3
    Views:
    522
    Christopher Benson-Manica
    Oct 12, 2007
  2. John Maclean
    Replies:
    1
    Views:
    469
    Martin P. Hellwig
    Apr 13, 2010
  3. Matt Chaput
    Replies:
    0
    Views:
    293
    Matt Chaput
    Feb 17, 2011
  4. Ulrich Eckhardt

    unit-profiling, similar to unit-testing

    Ulrich Eckhardt, Nov 16, 2011, in forum: Python
    Replies:
    6
    Views:
    558
    Roy Smith
    Nov 18, 2011
  5. Bill Mosteller
    Replies:
    0
    Views:
    389
    Bill Mosteller
    Oct 22, 2009
  6. Avi
    Replies:
    0
    Views:
    645
  7. Avi
    Replies:
    0
    Views:
    583
  8. James Harris

    C unit testing and regression testing

    James Harris, Aug 8, 2013, in forum: C Programming
    Replies:
    40
    Views:
    958
    Les Cargill
    Aug 17, 2013
Loading...