def test_setUidSameAsCurrentUid(self):
        """
        If the specified UID is the same as the current UID of the process,
        then a warning is displayed.
        """
        currentUid = os.getuid()
        self._setUID("morefoo", currentUid, "morebar", 4343)

        warningsShown = self.flushWarnings()
        self.assertEqual(1, len(warningsShown))
        expectedWarning = (
            'tried to drop privileges and setuid {} but uid is already {}; '
            'should we be root? Continuing.'.format(currentUid, currentUid))
        self.assertEqual(expectedWarning, warningsShown[0]["message"])

        If the specified UID is the same as the current UID of the process,
        then a warning is displayed.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_twistd.py