def test_warningsConfiguredAsErrors(self):
        class CustomWarning(Warning):
            pass

        result = TestResult()
        case = Mask.MockTests('test_unflushed')
        case.category = CustomWarning

        originalWarnings = warnings.filters[:]
        try:
            warnings.simplefilter('error')
            case.run(result)
            self.assertEqual(len(result.errors), 1)
            self.assertIdentical(result.errors[0][0], case)
            result.errors[0][1].trap(CustomWarning)
        finally:
            warnings.filters[:] = originalWarnings
deprecated; see shift
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/trial/test/test_warning.py/FlushWarningsTests.test_warningsConfiguredAsErrors--crossover with--dataset/ETHPy150Open manahl/mdf/mdf/context.py/_shift