diff --git a/CHANGELOG.md b/CHANGELOG.md index bcf3b11..c0c609a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ - Add python 3.13 to list of supported versions ([#158](https://github.com/mpytools/mplotutils/pull/158)). - Increased test coverage ([#180](https://github.com/mpytools/mplotutils/pull/180), [#181](https://github.com/mpytools/mplotutils/pull/181), - and [#182](https://github.com/mpytools/mplotutils/pull/182)). + [#182](https://github.com/mpytools/mplotutils/pull/182), and [#207](https://github.com/mpytools/mplotutils/pull/207)). ### Bug fixes diff --git a/mplotutils/tests/test_get_renderer.py b/mplotutils/tests/test_get_renderer.py index 9d9ac14..0a815f9 100644 --- a/mplotutils/tests/test_get_renderer.py +++ b/mplotutils/tests/test_get_renderer.py @@ -13,3 +13,19 @@ def test_get_renderer(backend): with figure_context() as f: _get_renderer(f) + + +def test_error_message_get_renderer(): + + # it's a fallback so should never be triggered - here I test the error message only + + backend = matplotlib.get_backend() + + class FakeFig: + def canvas(self): ... + + with pytest.raises( + AttributeError, + match=f"Could not find a renderer for the '{backend}' backend. Please raise an issue", + ): + _get_renderer(FakeFig())