On Tue, Sep 27, 2011 at 07:46:52PM +0100, Wilfred Hughes wrote:
> + def assertNotRaises(self, excClass, callableObj=None, *args, **kwargs):
> + """Fail if an exception of class excClass is thrown by
> + callableObj when invoked with arguments args and keyword
> + arguments kwargs.
> +
> + """
> + try:
> + callableObj(*args, **kwargs)
> + except excClass:
> + raise self.failureException("%s was raised" % excClass)
> +
> +
What if I want to assert my test raises neither OSError nor IOError?
Oleg.
--
Oleg Broytman http://phdru.name/ [email protected]
Programmers don't die, they just GOSUB without RETURN.
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com