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

Skip to content

Commit 3434eb5

Browse files
committed
MAINT: add ability to specify recursionlimit
We're getting a test failure on OSX and Python 3.6 where parsing reaches the recursion limit: #7799 Upping the recursionlimit resolves the error. Add command line argument to tests to up the recursion limit for the test run.
1 parent 17bf680 commit 3434eb5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import os
1313
import sys
1414
import time
15+
import argparse
1516

1617
import matplotlib
1718
matplotlib.use('agg')
@@ -50,5 +51,11 @@ def run(extra_args):
5051
disable_internet.turn_off_internet()
5152
extra_args.extend(['-a', '!network'])
5253
sys.argv.remove('--no-network')
53-
54+
# Get recursion limit
55+
parser = argparse.ArgumentParser()
56+
parser.add_argument('--recursionlimit', type=int, default=0,
57+
help='Specify recursionlimit for test run')
58+
found_args, sys.argv = parser.parse_known_args(sys.argv)
59+
if found_args.recursionlimit:
60+
sys.setrecursionlimit(found_args.recursionlimit)
5461
run(extra_args)

0 commit comments

Comments
 (0)