def test_pauseResume(self):
        """
        Cooperators should stop running their tasks when they're paused, and
        start again when they're resumed.
        """
        # first, sanity check
        self.scheduler.pump()
        self.assertEqual(self.work, [1])
        self.scheduler.pump()
        self.assertEqual(self.work, [1, 2])

        # OK, now for real
        self.task.pause()
        self.scheduler.pump()
        self.assertEqual(self.work, [1, 2])
        self.task.resume()
        # Resuming itself shoult not do any work
        self.assertEqual(self.work, [1, 2])
        self.scheduler.pump()
        # But when the scheduler rolls around again...
        self.assertEqual(self.work, [1, 2, 3])

        Cooperators should stop running their tasks when they're paused, and
        start again when they're resumed.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_cooperator.py