importwarningsimportpytestfrommatplotlib.testing.decoratorsimportcheck_figures_equal@pytest.mark.xfail(strict=True,reason="testing that warnings fail tests")deftest_warn_to_fail():warnings.warn("This should fail the test")@pytest.mark.parametrize("a",[1])@check_figures_equal(extensions=["png"])@pytest.mark.parametrize("b",[1])deftest_parametrize_with_check_figure_equal(a,fig_ref,b,fig_test):asserta==b