def test_box_recursion(check_dump): val = Value(0, 0, 0) exp = Box('Box with itself inside', val) exp.value = exp with pytest.raises(RuntimeError): exp.get() if sys.version_info >= (3, 5): exc_name = 'RecursionError' else: exc_name = 'RuntimeError' check_dump(exp, """ Box with itself inside <{e} while getting value>: (&1) Box with itself inside <{e} while getting value> (*1) """.format(e=exc_name))