def callDeprecated(self, version, f, *args, **kwargs):
        result = f(*args, **kwargs)
        warningsShown = self.flushWarnings([self.callDeprecated])

        if len(warningsShown) == 0:
            self.fail('%r is not deprecated.' % (f,))

        observedWarning = warningsShown[0]['message']
        expectedWarning = getDeprecationWarningString(f, version)
        self.assertEqual(expectedWarning, observedWarning)

        return result
Call a function that was deprecated at a specific version.
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/trial/unittest.py/TestCase.callDeprecated