Skip to content

Commit 53ed369

Browse files
authored
test error msg of _get_renderer (mpytools#207)
* test error msg of _get_renderer * changelog
1 parent d3a6a7e commit 53ed369

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
- Add python 3.13 to list of supported versions ([#158](https://github.com/mpytools/mplotutils/pull/158)).
2424
- Increased test coverage ([#180](https://github.com/mpytools/mplotutils/pull/180), [#181](https://github.com/mpytools/mplotutils/pull/181),
25-
and [#182](https://github.com/mpytools/mplotutils/pull/182)).
25+
[#182](https://github.com/mpytools/mplotutils/pull/182), and [#207](https://github.com/mpytools/mplotutils/pull/207)).
2626

2727
### Bug fixes
2828

mplotutils/tests/test_get_renderer.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,19 @@ def test_get_renderer(backend):
1313

1414
with figure_context() as f:
1515
_get_renderer(f)
16+
17+
18+
def test_error_message_get_renderer():
19+
20+
# it's a fallback so should never be triggered - here I test the error message only
21+
22+
backend = matplotlib.get_backend()
23+
24+
class FakeFig:
25+
def canvas(self): ...
26+
27+
with pytest.raises(
28+
AttributeError,
29+
match=f"Could not find a renderer for the '{backend}' backend. Please raise an issue",
30+
):
31+
_get_renderer(FakeFig())

0 commit comments

Comments
 (0)