8000 updated error message · matplotlib/matplotlib@26b9583 · GitHub
[go: up one dir, main page]

Skip to content

Commit 26b9583

Browse files
committed
updated error message
1 parent 28662f7 commit 26b9583

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/matplotlib/tests/test_ticker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ def test_arguments(self, func, args, expected):
10601060
("{}+{}+{}".format)],
10611061
ids=["function", "format"])
10621062
def test_typerror(self, func):
1063-
with pytest.raises(TypeError, match=r'function: 3'):
1063+
with pytest.raises(TypeError, match=r'3 arguments'):
10641064
mticker.FuncFormatter(func)
10651065

10661066
def test_other_builtins(self):

lib/matplotlib/ticker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ def __init__(self, func):
404404
elif nargs == 2:
405405
self.func = func
406406
else:
407-
raise TypeError(f"Number of parameters in function: {nargs}. "
407+
raise TypeError(f"{func.__name__} takes {nargs} arguments. "
408408
"FuncFormatter functions take at most 2: "
409409
"x (required), pos (optional).")
410410

0 commit comments

Comments
 (0)
0