Fixes #237

Sorry for typo in commit message
Please, use the ``with pytest.raises`` block to make sure the test fails if no exception is thrown.