[Tutor] Unit testing
Tino Dai
tinoloc at gmail.com
Wed Jun 28 22:29:53 CEST 2006
> Then where you create instances of those classes:
>
> sema = threading.semaphore()
> a = nameA(sema)
> b = nameB(sema)
>
>
> Maybe you don't even need the semaphore at all: have a look at
> Queue.Queue, it might do exactly what you need.
Ok, I think I'm going to back up and explain what I'm am heading towards.
I'm working on an app that fire off a bunch of threads. Each one of these
threads in connected via queues to another thread in a sequence like a
chain. And how I tell the next stage thread that there is data in the queue
is via semaphore. I couldn't come up with a better idea to control is
sequence without having to get into patterns (maybe there is a observer
pattern like in java for python, I don't know). And presently the global
semaphores work (I know it's bad programming practice and it will be fixed -
it's on the short list of thing to do). Presently, I'm reading about unit
testing because that's a relatively new field to me, and I understand the
basics of unit testing. It is the more depth concepts such as how the unit
test threads that's not apparent to me (which google doesn't seem to have).
Ok, back to searching!
-Tino
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060628/a1e6be5a/attachment.htm
More information about the Tutor
mailing list