diff --git a/pyomo/core/tests/unit/test_visitor.py b/pyomo/core/tests/unit/test_visitor.py index 29f3fb1bb8a..65b04ce90a3 100644 --- a/pyomo/core/tests/unit/test_visitor.py +++ b/pyomo/core/tests/unit/test_visitor.py @@ -1810,7 +1810,9 @@ def run_walker(self, walker): # overflow error cases = [] else: - cases = [(0, ""), (3, warn_msg)] + # 3 sufficed through Python 3.10, but appeared to need to be + # raised to 5 for recent 3.11 builds (3.11.2) + cases = [(0, ""), (5, warn_msg)] head_room = sys.getrecursionlimit() - get_stack_depth() for n, msg in cases: