def test_deprecatedTimeout(self):
        """
        L{twisted.internet.defer.timeout} is deprecated.
        """
        deferred = defer.Deferred()
        defer.timeout(deferred)
        self.assertFailure(deferred, defer.TimeoutError)
        warningsShown = self.flushWarnings([self.test_deprecatedTimeout])
        self.assertEqual(len(warningsShown), 1)
        self.assertIs(warningsShown[0]['category'], DeprecationWarning)
        self.assertEqual(
            warningsShown[0]['message'],
            'twisted.internet.defer.timeout was deprecated in Twisted 17.1.0;'
            ' please use twisted.internet.defer.Deferred.addTimeout instead')

        L{twisted.internet.defer.timeout} is deprecated.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_defer.py