This is actually available from both nose (old-style np.testing framework),
and pytest. Stdlib unittest supports self.assertRaises context manager from
python 3.1

On Wed, Aug 8, 2018, 7:30 PM Eric Wieser <wieser.eric+nu...@gmail.com>
wrote:

> Is another nice feature
>
> You forget that we already have that feature in our testing layer,
>
> with np.testing.assert_raises(AnException):
>     pass
>
> ​
>
> On Wed, 8 Aug 2018 at 09:08 Chris Barker - NOAA Federal <
> chris.bar...@noaa.gov> wrote:
>
>> BTW:
>>
>> with pytest.raises(AnException):
>>     ....
>>
>> Is another nice feature.
>>
>> -CHB
>> _______________________________________________
>> NumPy-Discussion mailing list
>> NumPy-Discussion@python.org
>> https://mail.python.org/mailman/listinfo/numpy-discussion
>>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion

Reply via email to