def test_pauseTwice(self):
        """
        Pauses on tasks should behave like a stack. If a task is paused twice,
        it needs to be resumed twice.
        """
        # pause once
        self.task.pause()
        self.scheduler.pump()
        self.assertEqual(self.work, [])
        # pause twice
        self.task.pause()
        self.scheduler.pump()
        self.assertEqual(self.work, [])
        # resume once (it shouldn't)
        self.task.resume()
        self.scheduler.pump()
        self.assertEqual(self.work, [])
        # resume twice (now it should go)
        self.task.resume()
        self.scheduler.pump()
        self.assertEqual(self.work, [1])

        Pauses on tasks should behave like a stack. If a task is paused twice,
        it needs to be resumed twice.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_cooperator.py