Use raises as context manager instead of a method decorator.
This clearly identifies which code part is expected to raise
an exception. Related to Issue #1128
nose is no longer maintained, thus we have to move to another
testing system. This commit updates the tox setup and all tests
to use pytest instead of nose.