diff --git a/pandas/core/config.py b/pandas/core/config.py index b6f00034429b2..7b1e5b29f1cbb 100644 --- a/pandas/core/config.py +++ b/pandas/core/config.py @@ -127,7 +127,11 @@ def _set_option(*args, **kwargs): root[k] = v if o.cb: - o.cb(key) + if silent: + with warnings.catch_warnings(record=True): + o.cb(key) + else: + o.cb(key) def _describe_option(pat='', _print_desc=True): diff --git a/pandas/core/config_init.py b/pandas/core/config_init.py index cf8a06465a7a4..f9b91db608093 100644 --- a/pandas/core/config_init.py +++ b/pandas/core/config_init.py @@ -253,7 +253,7 @@ def mpl_style_cb(key): warnings.warn(pc_mpl_style_deprecation_warning, FutureWarning, - stacklevel=4) + stacklevel=5) import sys from pandas.tools.plotting import mpl_stylesheet diff --git a/pandas/tests/test_categorical.py b/pandas/tests/test_categorical.py index 071e280bd112a..9305cabe6bda5 100755 --- a/pandas/tests/test_categorical.py +++ b/pandas/tests/test_categorical.py @@ -4109,7 +4109,8 @@ def test_str_accessor_api_for_categorical(self): ('decode', ("UTF-8",), {}), ('encode', ("UTF-8",), {}), ('endswith', ("a",), {}), - ('extract', ("([a-z]*) ",), {}), + ('extract', ("([a-z]*) ",), {"expand":False}), + ('extract', ("([a-z]*) ",), {"expand":True}), ('extractall', ("([a-z]*) ",), {}), ('find', ("a",), {}), ('findall', ("a",), {}),