code: def has_pending(self):
          
          if self.workqueue:
              return True
  
          for assigned_unit in self.assigned_work.values():
              if self._pending_of(assigned_unit) > 0:
                  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".