August 2018
Beginner
160 pages
4h 8m
English
You can use @pytest.mark.xfail decorator to indicate that a test is expected to fail. As usual, we apply the mark decorator to the test function or method:
@pytest.mark.xfaildef test_simulation_34(): ...
This mark supports some parameters, all of which we will see later in this section; but one in particular warrants discussion now: the strict parameter. This parameter defines two distinct behaviors for the mark:
Read now
Unlock full access