Benjamin Peterson <[EMAIL PROTECTED]> added the comment: On Fri, Sep 26, 2008 at 9:24 PM, Nick Edds <[EMAIL PROTECTED]> wrote: > > Nick Edds <[EMAIL PROTECTED]> added the comment: > > What do you think would be the best way to implement a test for this? To > test it, I ran it on a known file that caused the old recursive method > to fail, but I don't know if it makes sense to include that with the > tests. I could always write a test to verify that the iterative element > works, but as for testing the transition from recursive to iterative > when the recursion limit is exceeded, do you think that is something I > should do, and is there a better way than simply including the file that > I know causes the recursion limit to be exceeded?
I recommend generating a deeply nested structure and/or using sys.setrecursionlimit to make the recursion limit artificially low, and testing that refactoring works as planned. _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3358> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com