From 3434eb5076c250a6bdce9558454a24e53d76a66f Mon Sep 17 00:00:00 2001 From: Matthew Brett Date: Mon, 16 Jan 2017 10:55:29 -0800 Subject: [PATCH] MAINT: add ability to specify recursionlimit We're getting a test failure on OSX and Python 3.6 where parsing reaches the recursion limit: https://github.com/matplotlib/matplotlib/issues/7799 Upping the recursionlimit resolves the error. Add command line argument to tests to up the recursion limit for the test run. --- tests.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests.py b/tests.py index 94b0b1bb8d70..722c50a2c7cd 100755 --- a/tests.py +++ b/tests.py @@ -12,6 +12,7 @@ import os import sys import time +import argparse import matplotlib matplotlib.use('agg') @@ -50,5 +51,11 @@ def run(extra_args): disable_internet.turn_off_internet() extra_args.extend(['-a', '!network']) sys.argv.remove('--no-network') - + # Get recursion limit + parser = argparse.ArgumentParser() + parser.add_argument('--recursionlimit', type=int, default=0, + help='Specify recursionlimit for test run') + found_args, sys.argv = parser.parse_known_args(sys.argv) + if found_args.recursionlimit: + sys.setrecursionlimit(found_args.recursionlimit) run(extra_args)