Re: [Pyunit-interest] Assert Warning?
Brought to you by:
purcell
From: Steve P. <ste...@ya...> - 2003-09-01 09:28:29
|
On Monday 01 September 2003 02:57, Timothy Grant wrote: > Is it possible to assert that a warning was issued? or should I just set a > flag before the warning and then FailUnless(flag)? Hi Timothy, If you mean the built-in Python warnings, then I think you should be able to use warnings.filterwarnings() to set up a filter that turns matching warnings into exceptions so that you can test for them using TestCase.assertRaises(). Is that what you meant? -Steve -- Steve Purcell http://advogato.org/person/purcell |