[Mailman-Developers] (no subject)
Barry Warsaw
barry at list.org
Tue Jan 22 21:35:48 CET 2013
On Jan 21, 2013, at 10:40 AM, Sandesh Agrawal wrote:
>I am writing a test for lmtp runner as follows:
>
>def test_function(self):
> self._lmtp.sendmail(.........)
> messages = get_queue_messages('in')
> self.assertEqual(len(messages), 1)
>
> self._lmtp.sendmail(.........)
> messages = get_queue_messages('in')
> self.assertEqual(len(messages), 1)
>
>
>and the test passes successfully , but shouldn't the second
>self.assertEqual( ) fail because number of messages in 'in' should now
>be 2 .
One thing you can do when running tests that use runners in subprocesses
(e.g. spawned by TestableMaster), is pass in the -e option to bin/test so that
logging in the subprocesses is enabled. Such logging is suppressed by default
because of the noise, but enabling it lets you see if an exception occurs in a
runner that might only show up in the logs.
>Might be, self._lmtp is creating new lmtp instance each time it
>executes sendmail( ) , or is there something else ?
I don't think it does. My first guess is that there's an exception getting
masked.
Cheers,
-Barry
More information about the Mailman-Developers
mailing list