unit testing a routine that sends mail

Roy Smith roy at panix.com
Thu Feb 18 15:55:31 CET 2010

In article 
<a9524166-5b0f-4740-8123-e2582faeeedd at g26g2000yqn.googlegroups.com>,
 commander_coder <commander_coder at hotmail.com> wrote:

> The real puzzler for me is that the test reliably fails every third
> time.  For instance, if I try it six times then it succeeds the first,
> second, fourth, and fifth times.  I have to say that I cannot
> understand this at all but it certainly makes the unit test useless.

Just a wild guess here, but maybe there's some DNS server which 
round-robins three address records for some hostname you're using, one of 
which is bogus.

I've seen that before, and this smells like the right symptoms.

More information about the Python-list mailing list