Skip to content

Commit

Permalink
Access to exception message with str(error.value)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwouts committed Jun 30, 2019
1 parent 7ec3769 commit 4d737ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_cli.py
Expand Up @@ -931,7 +931,7 @@ def test_incorrect_notebook_causes_early_exit(tmpdir):
with pytest.raises(nbformat.reader.NotJSONError) as error:
jupytext([incorrect_ipynb, correct_ipynb, '--to', 'md'])

assert "Notebook does not appear to be JSON" in str(error)

This comment has been minimized.

Copy link
@RonnyPfannschmidt

RonnyPfannschmidt Jun 30, 2019

the match parameter of pytest.raises may help here

This comment has been minimized.

Copy link
@mwouts

mwouts Jun 30, 2019

Author Owner

That's a good idea! I will do that. Thanks

assert "Notebook does not appear to be JSON" in str(error.value)

assert not os.path.exists(incorrect_md)
assert not os.path.exists(correct_md)
Expand Down

0 comments on commit 4d737ce

Please sign in to comment.