Forbid to use pytest.mark.xfail
without a raises=
argument
#142
Labels
enhancement
New feature or request
pytest.mark.xfail
without a raises=
argument
#142
Today I got hit by a
xfail
problem. My module was decorated withpytest.mark.xfail
, because I wanted to test an explicit test failure in my plugin: https://github.com/dry-python/returns/blob/2223f03a2dbb96d4cd273fb41ad5c26331d9eef8/tests/test_contrib/test_hypothesis/test_laws/test_wrong_custom_type_with_init.py#L10But, under some condition, I've noticed that sometimes it was failing due to an unknown reason.
It was really hard to find, because this test was passing for a year now.
So, my idea is to:
pytest.mark.xfailure(raises=ExceptionType)
pytest.mark.xfailure
or ``pytest.mark.xfailure()`Docs: https://docs.pytest.org/en/6.2.x/skipping.html#raises-parameter
It hides errors 😞
The text was updated successfully, but these errors were encountered: