code: def run(self, messages, env=None):
          
          if not self.args.score or self.args.testing:
              return
  
          format.print_line('~')
          print('Scoring tests')
          print()
  
          raw_scores = OrderedDict()
          for test in self.assignment.specified_tests:
              assert isinstance(test, sources_models.Test), 'ScoringProtocol received invalid test'
  
              log.info('Scoring test {}'.format(test.name))
  
              # A hack that allows programmatic API users to plumb a custom
              # environment through to Python tests.
              # Use type to ensure is an actual OkTest and not a subclass
              if type(test) == ok_test_models.OkTest:
                  score = test.score(env=env)
              else:
                  score = test.score()
  
              raw_scores[test.name] = (score, test.points)
  
          messages['scoring'] = display_breakdown(raw_scores, self.args.score_out)
          print()
docs: Score tests and print results. Tests are taken from
          self.assignment.specified_tests. A score breakdown by question and the
          total score are both printed.
  
          ENV is used by the programatic API for Python doctests only.