|
9 | 9 | import pytest
|
10 | 10 | from pandas.compat import intern
|
11 | 11 | from pandas.util._move import move_into_mutable_buffer, BadMove, stolenbuf
|
12 |
| -from pandas.util._decorators import deprecate_kwarg |
| 12 | +from pandas.util._decorators import deprecate_kwarg, make_signature |
13 | 13 | from pandas.util._validators import (validate_args, validate_kwargs,
|
14 | 14 | validate_args_and_kwargs,
|
15 | 15 | validate_bool_kwarg)
|
@@ -467,3 +467,17 @@ def test_set_locale(self):
|
467 | 467 |
|
468 | 468 | current_locale = locale.getlocale()
|
469 | 469 | assert current_locale == self.current_locale
|
| 470 | + |
| 471 | + |
| 472 | +def test_make_signature(): |
| 473 | + # See GH 17608 |
| 474 | + # Case where the func does not have default kwargs |
| 475 | + sig = make_signature(validate_kwargs) |
| 476 | + assert sig == (['fname', 'kwargs', 'compat_args'], |
| 477 | + ['fname', 'kwargs', 'compat_args']) |
| 478 | + |
| 479 | + # Case where the func does have default kwargs |
| 480 | + sig = make_signature(deprecate_kwarg) |
| 481 | + assert sig == (['old_arg_name', 'new_arg_name', |
| 482 | + 'mapping=None', 'stacklevel=2'], |
| 483 | + ['old_arg_name', 'new_arg_name', 'mapping', 'stacklevel']) |
0 commit comments