On Wed, Apr 05, 2017 at 05:49:24PM +0200, Ronny Pfannschmidt wrote: > i meant the except clause
I know, I was just pointing out that there's no valid use case for
pytest.raises(None) already, as None can never be raised.
In fact, pytest.raises(None) already *does* error out, even on Python 2:
>>> pytest.raises(None)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/home/florian/tmp/.venv/lib/python2.7/site-packages/_pytest/python.py", line
1191, in raises
raise TypeError(msg % type(expected_exception))
TypeError: exceptions must be old-style classes or derived from
BaseException, not <type 'NoneType'>
You could as well argue that "except" not doing type checking is simply
a Python 2 bug, and the code in it will never be run anyways.
Florian
--
http://www.the-compiler.org | [email protected] (Mail/XMPP)
GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
I love long mails! | http://email.is-not-s.ms/
signature.asc
Description: PGP signature
_______________________________________________ pytest-dev mailing list [email protected] https://mail.python.org/mailman/listinfo/pytest-dev
