def test_stopObserving(self):
        """
        L{reporter.Reporter} stops observing log events when its C{done} method
        is called.
        """
        self.result.done()
        self.stream.seek(0)
        self.stream.truncate()
        self.publisher.msg(
            warning=RuntimeWarning("some message"),
            category='exceptions.RuntimeWarning',
            filename="file/name.py", lineno=17)
        self.assertEqual(self.stream.getvalue(), "")

        L{reporter.Reporter} stops observing log events when its C{done} method
        is called.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/test/test_reporter.py