Skip to content

Commit

Permalink
fix incorrect DeprecationWarning expectation on .render() with 3 …
Browse files Browse the repository at this point in the history
…positional arguments

- fix #215
- follow-up 99b4e62
  • Loading branch information
xflr6 committed Feb 28, 2024
1 parent 6fe8c4e commit f4f2daa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/backend/test_rendering.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import contextlib
import pathlib
import os
import shutil
Expand Down Expand Up @@ -35,8 +36,12 @@ def test_render_missing_file(quiet, engine='dot', format_='pdf'):
graphviz.RequiredArgumentError, r'without renderer'),
(['dot', 'ps', 'nonfilepath', 'ps', ''], ValueError, r'unknown formatter')],
ids=lambda x: getattr(x, '__name__', x))
def test_render_unknown_parameter_raises(args, expected_exception, match):
with pytest.raises(expected_exception, match=match), pytest.deprecated_call():
def test_render_unknown_parameter_raises(args, expected_exception, match,
supported_number=3):
checker = (pytest.deprecated_call(match=rf'{supported_number:d} positional args')
if len(args) > supported_number
else contextlib.nullcontext())
with pytest.raises(expected_exception, match=match), checker:
graphviz.render(*args)


Expand Down

0 comments on commit f4f2daa

Please sign in to comment.