Example #1
0
 def _create(self, src, disable=()):
     self.num_lines = len(src.rstrip().splitlines())
     src = textwrap.dedent(src)
     src_tree = directors.parse_src(src, self.python_version)
     self._errorlog = errors.ErrorLog()
     if self.python_version < (3, 8):
         raw_code = pyc.compile_src(src, _TEST_FILENAME,
                                    self.python_version, None)
         code = blocks.process_code(raw_code, self.python_version)
     else:
         code = None
     self._director = directors.Director(src_tree, self._errorlog,
                                         _TEST_FILENAME, disable, code)
Example #2
0
 def _create(self, src, disable=()):
     self._errorlog = errors.ErrorLog()
     self._director = directors.Director(src, self._errorlog,
                                         _TEST_FILENAME, disable)
Example #3
0
 def _InitErrorLog(self, src, filename=None):
   errorlog = errors.ErrorLog()
   director = directors.Director(src, errorlog, filename, ())
   errorlog.set_error_filter(director.should_report_error)
   return errorlog