code: def has_pending(self):
          
          if self.pending:
              return True
          for pending in self.node2pending.values():
              if pending:
                  return True
          return False
docs: Return True if there are pending test items
  
          This indicates that collection has finished and nodes are
          still processing test items, so this can be thought of as
          "the scheduler is active".