Right now it's not straightforward to conditionally mark a test as thread-unsafe.
I'm working on a bug in CFFI that only manifests on MacOS. In order to express this, I have to write this right now:
@(pytest.mark.thread_unsafe(reason="unsafe on MacOS")
if sys.platform == "darwin" else lambda f: f)
def test_thread_unsafe_on_mac():
...
It would be a lot nicer if we could do:
@pytest.mark.thread_unsafe(reason="unsafe on MacOS", condition=sys.platform == "darwin")
def test_thread_unsafe_on_mac():
...
Here condition behaves identically to the condition argument for pytest.mark.skipif: https://docs.pytest.org/en/stable/reference/reference.html#pytest-mark-skipif
Right now it's not straightforward to conditionally mark a test as thread-unsafe.
I'm working on a bug in CFFI that only manifests on MacOS. In order to express this, I have to write this right now:
It would be a lot nicer if we could do:
Here
conditionbehaves identically to theconditionargument forpytest.mark.skipif: https://docs.pytest.org/en/stable/reference/reference.html#pytest-mark-skipif