2
我有一個py.test測試功能標記爲xfail:在py.test中,當我顯式跳過標記爲xfail的測試時,如何才能將其報告爲「跳過」而不是「xfailed」?
@pytest.mark.xfail
def test_that_fails():
assert 1 == 2
在我pytest_runtest_setup()掛鉤,我明確地跳過這個測試:
def pytest_runtest_setup (item):
pytest.skip ('Skipping this test')
當我運行py.test,它會報告測試xfailed:
tests.py x
========================== 1 xfailed in 1.69 seconds ===========================
我該如何讓py.test報告這個測試被跳過?
看起來我在問:「我的pytest_runtest_setup()鉤子中如何刪除xfail標記形式的測試?」
謝謝。