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