def _testDeprecatedClass(self, klass):
        """
        Assert that accessing the given class was deprecated.

        @param klass: The class being deprecated.
        @type klass: L{str}
        """
        getattr(client, klass)

        warningInfo = self.flushWarnings()
        self.assertEqual(len(warningInfo), 1)
        self.assertEqual(warningInfo[0]['category'], DeprecationWarning)
        self.assertEqual(
            warningInfo[0]['message'],
            "twisted.web.client.{} was deprecated in "
            "Twisted 16.7.0: please use https://pypi.org/project/treq/ or twisted.web.client.Agent instead".format(klass))

        Assert that accessing the given class was deprecated.

        @param klass: The class being deprecated.
        @type klass: L{str}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_webclient.py