test_testing.py 449 B

1234567891011121314151617
  1. import warnings
  2. import pytest
  3. from matplotlib.testing.decorators import check_figures_equal
  4. @pytest.mark.xfail(
  5. strict=True, reason="testing that warnings fail tests"
  6. )
  7. def test_warn_to_fail():
  8. warnings.warn("This should fail the test")
  9. @pytest.mark.parametrize("a", [1])
  10. @check_figures_equal(extensions=["png"])
  11. @pytest.mark.parametrize("b", [1])
  12. def test_parametrize_with_check_figure_equal(a, fig_ref, b, fig_test):
  13. assert a == b