def test_stopProducingClosesFile(self):
        """
        L{StaticProducer.stopProducing} closes the file object the producer is
        producing data from.
        """
        fileObject = StringIO()
        producer = static.StaticProducer(None, fileObject)
        producer.stopProducing()
        self.assertTrue(fileObject.closed)

        L{StaticProducer.stopProducing} closes the file object the producer is
        producing data from.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_static.py