[docs]defbegin_test(self,name):""" Redirects output to a :epkg:`*py:io:StringIO`. :param name: name :githublink:`%|py|67` """ifself.toisnotNone:raiseException("A test has not finished: '{0}'".format(self.to))ifnameisNone:raiseValueError("name is None")self.to=nameself.redirect[name]=StringIO()