[TIP] How would you test something that deals with processes?

Ben Finney ben+python at benfinney.id.au
Mon Jun 6 18:07:40 PDT 2011


John Anderson <sontek at gmail.com> writes:

> Would you just mock out the process list and test that if you pass it
> a process list it calls send_signal?

That's one approach. You could get closer to the actual behaviour by
mocking processes (or at least Python's interface to them); that way you
can make all kinds of misbehaviour for your mock processes, and test how
your code responds.

-- 
 \       “If we listen only to those who are like us, we will squander |
  `\   the great opportunity before us: To live together peacefully in |
_o__)            a world of unresolved differences.” —David Weinberger |
Ben Finney




More information about the testing-in-python mailing list