def test_cannotPauseProduction(self):
        """
        When the L{NonStreamingProducer} is paused, it raises a
        L{RuntimeError}.
        """
        consumer = TestConsumer()
        producer = NonStreamingProducer(consumer)
        consumer.registerProducer(producer, False)

        # Produce once, just to be safe.
        producer.resumeProducing()

        self.assertRaises(RuntimeError, producer.pauseProducing)

        When the L{NonStreamingProducer} is paused, it raises a
        L{RuntimeError}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/test_testing.py