Brian Okken
Brian Okken
Another alternate workaround is to put the original workaround in a fixture: ```python @pytest.fixture() def xfail(request): def _xfail(reason=''): request.node.add_marker(pytest.mark.xfail(reason=reason)) return _xfail def test_xfail_pass(xfail): xfail(reason='should xpass') assert 1 == 1 def...
After looking at the code I was worried about the need for a `request` object to be passed in. It's not a real clean interface then, but would work. Is...
@RonnyPfannschmidt I'm glad you have an idea about this. I don't know understand really how contextvar wold be applied.
Until we get this sorted out, I've added a plugin for the workaround, [pytest-runtime-xfail](https://github.com/okken/pytest-runtime-xfail). The name's a bit long, but it works-ish. I'd rather have it built into the `pytest.xfail()`.
fixed with version 1.0.6
Failing early isn't something I considered before, but not a bad idea. Maybe something like an `assert_no_failures()` function. Would that work for your use cases?
Thanks for this, I'll check it out.
thanks for the info
I agree that it would be nice if showlocals worked with this plugin. If you'd like to work on a PR for this, that'd be cool.