Re: [Pyunit-interest] Assert Warning?
Brought to you by:
purcell
|
From: Timothy G. <tj...@cr...> - 2003-09-01 16:50:41
|
On Monday 01 September 2003 02:28 am, Steve Purcell wrote:
> 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?
Exactly! Thanks much, I appreciate the assistance.
--
Stand Fast,
tjg.
Timothy Grant
www.craigelachie.org
|