Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5827bde

Browse files
committed
Deprecate recursionlimit kwarg to matplotlib.test().
It was added in c013ed7 to apparently fix a failure on OSX/Py36, but in fact it's been unused ever since MacPython/matplotlib-wheels@90a94c0 (merely a month later), and tests apparently still pass fine.
1 parent 8ac3ea1 commit 5827bde

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

doc/api/next_api_changes/deprecations.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,3 +232,7 @@ Axes navigation can still be toggled programmatically using
232232
The following related APIs are also deprecated:
233233
``backend_tools.ToolEnableAllNavigation``,
234234
``backend_tools.ToolEnableNavigation``, and ``rcParams["keymap.all_axes"]``.
235+
236+
``matplotlib.test(recursionlimit=...)``
237+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
238+
The *recursionlimit* parameter of ``matplotlib.test`` is deprecated.

lib/matplotlib/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,6 +1177,7 @@ def _init_tests():
11771177

11781178

11791179
@cbook._delete_parameter("3.2", "switch_backend_warn")
1180+
@cbook._delete_parameter("3.3", "recursionlimit")
11801181
def test(verbosity=None, coverage=False, switch_backend_warn=True,
11811182
recursionlimit=0, **kwargs):
11821183
"""Run the matplotlib test suite."""

tests.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,14 @@
3939
from matplotlib import test
4040

4141
parser = argparse.ArgumentParser(add_help=False)
42-
parser.add_argument('--recursionlimit', type=int, default=0,
42+
parser.add_argument('--recursionlimit', type=int, default=None,
4343
help='Specify recursionlimit for test run')
4444
args, extra_args = parser.parse_known_args()
4545

4646
print('Python byte-compilation optimization level:', sys.flags.optimize)
4747

48-
retcode = test(argv=extra_args, recursionlimit=args.recursionlimit)
48+
if args.recursionlimit is not None: # Will trigger deprecation.
49+
retcode = test(argv=extra_args, recursionlimit=args.recursionlimit)
50+
else:
51+
retcode = test(argv=extra_args)
4952
sys.exit(retcode)

0 commit comments

Comments
 (0)