This PR is very much optional. I noticed that you were using pytest.mark.xfail to mark tests that raise specific Exceptions. This might be my OCD talking, but it's not the intended usage for xfail, which should be used to mark tests that either fail due to missing implementations or because they are expected to fail due to other reasons: https://docs.pytest.org/en/6.2.x/skipping.html
If the code should raise an Exception due to wrong input or other mistakes it's better to use pytest.raises.
In your test-suite it seemed to me that only two tests qualified for being marked as xfail.
Again, this is a very minor distinction. Feel free to close the PR if you prefer using xfail.
Thanks for sorting this out. I was confused about expected failures vs expected exceptions when I made the transition to pytest. I'll gladly merge this PR.
Hi @mdshw5,
This PR is very much optional. I noticed that you were using
pytest.mark.xfail
to mark tests that raise specific Exceptions. This might be my OCD talking, but it's not the intended usage for xfail, which should be used to mark tests that either fail due to missing implementations or because they are expected to fail due to other reasons: https://docs.pytest.org/en/6.2.x/skipping.htmlIf the code should raise an Exception due to wrong input or other mistakes it's better to use
pytest.raises
.In your test-suite it seemed to me that only two tests qualified for being marked as xfail. Again, this is a very minor distinction. Feel free to close the PR if you prefer using xfail.
Cheers, Andreas :smiley: